Logo
(追記) (追記ここまで)

33221번 - Cake Promise 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB115795571.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:

  • One line containing two integers $t$ and $p$ (2ドル\leq t, p\leq 1000$), the number of teams participating and the number of programming problems, respectively. Professor Wright counts as one of the teams.
  • $t$ lines, each containing $p$ values, the results for each team. The first line represents the results of professor Wright. Each result is either "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.

제한

예제 입력 1

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

예제 출력 1

2

예제 입력 2

4 4
4 5 6 X
4 5 X 5
4 X 5 6
X 4 5 7

예제 출력 2

2

힌트

출처

University > Delft University of Technology > Freshmen Programming Contest 2022 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /