QOJ.ac

QOJ

Süre Sınırı: 1 s Bellek Sınırı: 64 MB Toplam puan: 20

#23751. 설문 조사

İstatistikler

문제

어느 학교에서 수학여행을 갈 계획이 있다. 이를 위해 설문 조사를 실시했다. 학생은 $1$부터 $n$까지의 학생 번호를 가지며, 여행 후보 장소를 $1$부터 $m$까지의 번호로 나타내고, 가고 싶은 장소에 $\circ$, 가고 싶지 않은 장소에 $\times$ 표시를 하여 제출하였다.

이때, 가고 싶은 장소의 학생 수가 많은 순서대로 장소의 번호를 출력하는 프로그램을 작성하여라. 학생 수가 같을 때에는 장소의 번호 순서대로 한다.

입력 파일의 파일 이름은 input.txt이다. input.txt의 $1$번째 줄에는 학생 수 $n$과 여행 후보 장소의 수 $m$이 공백으로 구분되어 있고, $i + 1$번째 줄에는 학생 $i$의 설문 조사 결과를 $\circ$는 $1$로, $\times$는 $0$으로 나타내어 공백으로 구분된 $m$개의 숫자가 나열되어 있다. $1 \le n \le 1000, 1 \le m \le 100$으로 한다.

출력 파일의 파일 이름은 output.txt이다. output.txt에서는 출력(장소의 번호) 뒤에 줄바꿈을 넣을 것.

입출력 예 1

입력 예 1

4 6
1 0 1 0 1 1
1 1 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0

출력 예 1

1 3 2 5 4 6

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.