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

34360번 - IMO 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 2048 MB32266.667%

문제

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.

입력

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.

제한

  • 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$.

서브태스크

번호배점제한
110

$N = M = 2$ and $K = 1$

213

$N = 2$

310

$N \cdot M \leq 16$

418

$K = 1$

521

$N \leq 10,000円$ and $M,K \leq 10$

628

No additional constraints

예제 입력 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

예제 출력 1

20

예제 입력 2

2 1 1
1
0

예제 출력 2

1

예제 입력 3

2 2 7
7 4
7 0

예제 출력 3

2

예제 입력 4

2 2 1
0 1
1 0

예제 출력 4

2

힌트

예제

In the first example, the 20ドル$ scores can be revealed in the following way:

7ドル$ 7ドル$ 0ドル$ $\bullet$ 7ドル$ $\bullet$
7ドル$ 3ドル$ 0ドル$ 7ドル$ 2ドル$ 1ドル$
$\bullet$ 0ドル$ 0ドル$ $\bullet$ 0ドル$ 0ドル$
7ドル$ 7ドル$ 7ドル$ 7ドル$ 7ドル$ 1ドル$

Here, the third contestant is known to have a total score between 0ドル$ and 14ドル,ドル which is definitely lower than any other score. It can be shown that it is impossible to reveal fewer than 20ドル$ scores. For example, if we were to hide one of the zeroes of the third contestant, then this contestant could have a total score of up to 21ドル$. This is a problem because the second contestant has a total score of 20ドル,ドル but should be guaranteed to rank higher than the third contestant.

The first sample satisfies the constraints of test groups 5ドル$ and 6ドル$.

In the second example, we can either reveal only the first contestant's only score, or reveal only the second contestant's only score (but not both). If we reveal only the first contestant's score, then we know that the first contestant has a total score of 1ドル$. This means that even if the second contestant also has a score of 1ドル,ドル the first contestant will rank higher because their index is lower. Similarly, if we only reveal the score of the second contestant, we know that they have a score of zero, which means that the first contestant will rank higher regardless of their score.

The second sample satisfies the constraints of test groups 2ドル,ドル 3ドル,ドル 4ドル,ドル 5ドル,ドル and 6ドル$.

The third sample satisfies the constraints of test groups 2ドル,ドル 3ドル,ドル 5ドル,ドル and 6ドル$.

The fourth sample satisfies the constraints of all test groups.

출처

Olympiad > European Girls' Olympiad in Informatics > EGOI 2025 > Day 2 C번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
  • 이 문제의 채점 우선 순위는 2이다.
(追記) (追記ここまで)

출처

대학교 대회

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

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