Scoreboard Screenshots
시간 제한2초메모리 제한256 MB
각 스크린샷이 K개 팀의 점수를 담고 있을 때, 모든 팀의 점수가 감소하지 않도록 스크린샷 N개의 순서를 정한다.
문제
The MITIT 2025 Winter Contest has successfully ended with the participation of teams, and Busy Beaver has to write a report for the contest.
For the report, Busy Beaver took screenshots of the scoreboard during the contest. Each screenshot contains the scores of all 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 and (; ) — the number of screenshots and teams.
The -th of the next lines contains integers (), where is the score of the -th team in the -th screenshot.
출력
If a valid ordering exists, print “YES” (without quotes) on the first line. On the second line, print integers , where is the index of the -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).