P1678 烦恼的高考志愿-二分
Codeforces Gym - 101234A Hacker Cups and Balls [二分+线段树]
[luogu-2678]noip2015day2-T1 跳石头 题解