RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
문제 R03751

IMO

설명

The International Mathematics Olympiad (IMO) is a maths competition for high school students that is held every year. The 2025 edition of the IMO takes place at the same time as the EGOI. As you are reading this, both contest days of the IMO have ended and the grading is probably almost done as well. Unlike programming competitions like the EGOI, the grading is done by hand, which is a long and arduous process.

This year the IMO had \(M\) problems (numbered from \(0\) to \(M-1\)), and each problem is worth a maximum of \(K\) points. There were \(N\) contestants taking part in the contest. The \(i\)th contestant received a score of \(a_{i,j}\) on problem \(j\), where \(a_{i,j}\) is an integer between \(0\) and \(K\), inclusive. The ranking of the contestants is determined by the total score of each contestant, with ties broken by the contestants' indices. More formally, contestant \(x\) ranks higher than contestant \(y\) if:
- either the total score of contestant \(x\) is bigger than the total score of contestant \(y\),
- or their total scores are the same and \(x < y\).

In order to release the final ranking, the organizers need to publish some of the values \(a_{i,j}\). If a value is unpublished, it is only known that it is an integer between \(0\) and \(K\), inclusive.

The organizers want to reveal as few of the values \(a_{i,j}\) as possible. At the same time, they need to make sure that everyone knows the correct final ranking. In other words, they must reveal a set of values such that the only ranking consistent with it is the correct one.

Find the smallest \(S\) such that it is possible to reveal \(S\) of the values \(a_{i,j}\) in a way that uniquely determines the full ranking of the contestants.

제약
  • \(2 \leq N \leq 20\,000\).
  • \(1 \leq M \leq 100\).
  • \(1 \leq K \leq 100\).
  • \(0 \leq a_{i,j} \leq K\) for every pair \(i,j\) where \(0 \leq i \leq N-1\) and \(0\leq j \leq M-1\).

Your solution will be tested on a set of test groups, each worth a number of points. Each test group contains a set of test cases. To get the points for a test group, you need to solve all test cases in the test group.

Group | Score | Limits 1 | 10 | \(N = M = 2\) and \(K = 1\) 2 | 13 | \(N = 2\) 3 | 10 | \(N \cdot M \leq 16\) 4 | 18 | \(K = 1\) 5 | 21 | \(N \leq 10\,000\) and \(M,K \leq 10\) 6 | 28 | No additional constraints

입력 형식

The first line contains three integers \(N\), \(M\), and \(K\): the number of contestants, the number of problems, and the maximum score of the tasks, respectively.

Then follow \(N\) lines, where the \(i\)th line contains \(a_{i,j}\). That is, the first of these contains \(a_{0,0}, a_{0,1}, \ldots, a_{0, M-1}\), the second contains \(a_{1,0}, a_{1,1}, \ldots, a_{1, M-1}\), and so on.

출력 형식

Print one integer \(S\), the minimum number of scores that can be revealed so that the final ranking is uniquely determined.

서브태스크
서브태스크점수설명

Subtask 1

10점

None

Subtask 2

13점

None

Subtask 3

10점

None

Subtask 4

18점

None

Subtask 5

21점

None

Subtask 6

28점

None

예제 1
입력
4 6 7
7 7 0 2 7 0
7 3 0 7 2 1
7 0 0 7 0 0
7 7 7 7 7 1
출력
20
예제 2
입력
2 1 1
1
0
출력
1
예제 3
입력
2 2 7
7 4
7 0
출력
2
예제 4
입력
2 2 1
0 1
1 0
출력
2
문제 정보

rip 작성

출처 EGOI 2025

평가 및 의견

IMO

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

IMO

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8