QOJ.ac

QOJ

时间限制: 1 s 内存限制: 64 MB 总分: 20

#23751. 問題 1

统计

問題文

ある学校で修学旅行へ行く計画がある.そのためにアンケート調査を行った.生徒は $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

入力例

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