SuperhumanOA #2
Math Homework
估计中等可在线判题
考点(AI 标注)贪心调度
Start from index 0 and move +1 or +2 at each step; stop as soon as the spread of the solved points first reaches threshold; if it can never be reached, solve the entire array as the problem states.
See "Input" for the standard input/output conventions and constraints added by this site.
输入格式
points is non-decreasing, n≤100000, and the values and threshold are in 1..999.
输出格式
Output the minimum number of problems; if the threshold cannot be reached, output n.
样例 1
输入:
5 4
1 2 3 5 8
输出:
3
样例 2
输入:
5 4
1 2 3 4 5
输出:
3
样例 3
输入:
4 10
4 5 6 7
输出:
4
样例 4
输入:
1 1
1
输出:
1