Problems > Minimum Eating Speed > Editorial

Minimum Eating Speed — Solution & Editorial

Back to the Problem

Hours needed is non-increasing in k — binary search k in [1, max pile], computing ∑⌈p/k⌉ per candidate.

Complexity: O(N log max)

Watch out: Use integer ceiling (p + k - 1) / k, not floating point.