USACO Bronze 2018 December - The Bucket List

The internal solution for “The Bucket List” problem, " Solution 2 - Sweep" code, I think has a problem yet it passes.
the problem is in this line “change[end] -= amt;”
i think it should be like this “change[end + 1] -= amt;”
which by the way it passes too, after making the change.

Actually, both work since all endpoints are distinct.

1 Like