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

33255번 - Scoreboard Screenshots 서브태스크스페셜 저지다국어

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

제한

서브태스크

번호배점제한
120

$K=1$.

280

No additional constraints.

예제 입력 1

3 2
1 1
0 0
0 1

예제 출력 1

YES
2 3 1

In the first test case, a valid ordering of the screenshots is:

  • Second screenshot: Team 1ドル$ has score 0ドル,ドル and Team 2ドル$ has score 0ドル$.
  • Third screenshot: Team 1ドル$ has score 0ドル,ドル and Team 2ドル$ has score 1ドル$.
  • First screenshot: Team 1ドル$ has score 1ドル,ドル and Team 2ドル$ has score 1ドル$.

예제 입력 2

3 3
0 0 1
1 0 0
0 1 0

예제 출력 2

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번

  • 문제를 만든 사람: 79brue

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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