| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 115 | 79 | 55 | 71.429% |
Today is the big day: professor P. Wright is organizing a programming contest. All of his students are participating, because he has promised to bake a cake for all teams that can beat him in the contest.1 After the contest has ended, professor Wright receives a raw copy of the scoreboard, in which the teams are out of order. He is short on time: besides baking, he also has some exams to grade. Therefore, he needs a program to calculate how many teams beat him in the contest.
The contest consists of a given number of problems, which the teams will need to solve as fast as possible. One team beats another team if the number of problems solved by the first team is strictly greater. If the number of problems solved is equal between two teams, the team that required a lower sum of minutes to solve the problems beats the other. Professor Wright is also willing to bake a cake for teams that solved the same number of problems and required the same sum of minutes as himself.
1All characters and events in this problem description are fictional. Any resemblance to actual lecturers is purely coincidental.
The input consists of:
X", indicating that the team did not solve this problem, or an integer $r$ (1ドル\leq r\leq 10^6$), representing the number of minutes that this team needed to solve the problem.Output the number of teams for which professor Wright needs to bake a cake.
5 5 40 X 10 30 20 X X 20 50 40 50 40 20 30 10 X X 30 X 50 X 30 5 40 20
2
4 4 4 5 6 X 4 5 X 5 4 X 5 6 X 4 5 7
2