Skip to content

Koko Eating Bananas#137

Open
tom4649 wants to merge 2 commits into
mainfrom
875.Koko-Eating-Bananas
Open

Koko Eating Bananas#137
tom4649 wants to merge 2 commits into
mainfrom
875.Koko-Eating-Bananas

Conversation

@tom4649

@tom4649 tom4649 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

left = max(min(piles) // h, 1)
right = max((max(piles) * 2 - 1) // (h // len(piles)), 1) + 1
while left < right:
mid = left + (right - left) // 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python の int は格納できる数値の大きさに実質上限がないため、オーバーフローを回避する書き方はしなくてよいと思います。

mid = (left + right) // 2

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今後はそのように書こうと思います。
他の言語や numpy を使用する場合を想定していましたが、この場合は不要ですね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants