#P2777. [AHOI2016初中组] 自行车比赛
[AHOI2016初中组] 自行车比赛
Description
Xiaoxue is very interested in bicycle races, especially the Tour of Binhu Lake. The annual Tour of Binhu Lake requires riders to compete for several consecutive days, and the champion is decided by total accumulated points. This year there are contestants. Each day’s race produces a ranking: the first-place finisher earns points, the second-place finisher earns points, the third-place finisher earns points, and so on, with the last-place finisher earning point. It is guaranteed that no two contestants share the same rank on a given day.
Over the previous days, the contestants have already accumulated some points. The final day is about to begin. Xiaoxue wants to know how many contestants still have a chance to become the overall champion — that is, how many contestants can possibly finish with the highest total after the last day’s race.
Input Format
The first line contains an integer , the total number of contestants, with .
Then follow lines. The -th line contains an integer , the accumulated points already earned by contestant , with .
Output Format
Output a single line containing one integer: the number of contestants who can still become the final champion.
3
8
10
9
3
5
15
14
15
12
14
4
Hint
Constraints and Conventions
- For of the testdata, .
- For of the testdata, .
- For of the testdata, and .
Translated by ChatGPT 5
京公网安备 11011102002149号