| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 256 MB | 39 | 26 | 18 | 64.286% |
The MITIT 2025 Winter Contest has successfully ended with the participation of $K$ teams, and Busy Beaver has to write a report for the contest.
For the report, Busy Beaver took $N$ screenshots of the scoreboard during the contest. Each screenshot contains the scores of all $K$ teams when the screenshot was taken.
Unfortunately, Busy Beaver forgot in which order he took the screenshots! He assumes that if there were no regrades during the contest, each team’s score will be nondecreasing over time. Under this assumption, Busy Beaver wants to recover the order of the screenshots.
Determine if there is a valid ordering such that no team’s score decreases over time, and if it exists, print any such order.
The first line contains two integers $N$ and $K$ (2ドル\leq N\leq 400$; 1ドル\leq K\leq 400$) — the number of screenshots and teams.
The $i$-th of the next $N$ lines contains $K$ integers $a_{i,1},a_{i,2},\cdots ,a_{i,k}$ (0ドル\leq a_{i,j}\leq 900$), where $a_{i,j}$ is the score of the $j$-th team in the $i$-th screenshot.
If a valid ordering exists, print “YES” (without quotes) on the first line. On the second line, print $N$ integers $b_1,\cdots ,b_N,ドル where $b_i$ is the index of the $i$-th screenshot in the valid ordering. If there are multiple solutions, you can print any of them.
If there is no valid ordering, print “NO” (without quotes).
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 20 | $K=1$. |
| 2 | 80 | No additional constraints. |
3 2 1 1 0 0 0 1
YES 2 3 1
In the first test case, a valid ordering of the screenshots is:
3 3 0 0 1 1 0 0 0 1 0
NO
In the second test case, no valid ordering exists because it is impossible to arrange the screenshots so that all scores for each team are nondecreasing over time.
University > MIT > M(IT)^2 > M(IT)^2 Winter 2025 Tournament > Beginner Round 4번