QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 64 MB مجموع النقاط: 20

#23751. 問卷調查

الإحصائيات

題目描述

某所學校計畫去修學旅行,並為此進行了一次問卷調查。學生擁有從 $1$ 到 $n$ 的學生編號,旅行的候選地點以從 $1$ 到 $m$ 的編號表示,學生在想去的地方標上 $\circ$,在不想去的地方標上 $\times$ 後提交問卷。

此時,請撰寫一個程式,依想去的人數由多到少的順序輸出地點的編號。當人數相同時,依地點編號由小到大的順序排列。

輸入檔案的檔名為 input.txt。input.txt 的第 $1$ 行包含以空白分隔的學生人數 $n$ 與旅行候選地點的數量 $m$,第 $i + 1$ 行排列著以空白分隔的 $m$ 個數字,表示學生 $i$ 的問卷結果,其中 $\circ$ 以 $1$ 表示,$\times$ 以 $0$ 表示。設 $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.