QOJ.ac

QOJ

시간 제한: 1 s 메모리 제한: 64 MB 총점: 20

#23751. סקר שאלונים

통계

תיאור הבעיה

בבית ספר מסוים מתכננים לצאת לטיול שנתי, ולשם כך נערך סקר באמצעות שאלון. לתלמידים יש מספרי תלמיד מ-$1$ עד $n$, והמקומות המועמדים לטיול מיוצגים על ידי מספרים מ-$1$ עד $m$. כל תלמיד מגיש את השאלון כאשר הוא מסמן $\circ$ במקומות שאליהם הוא רוצה ללכת ו-$\times$ במקומות שאליהם אינו רוצה ללכת.

כתבו תוכנית המדפיסה את מספרי המקומות בסדר יורד של מספר התלמידים הרוצים לבקר בהם. כאשר מספר התלמידים זהה, יש לסדרם לפי מספרי המקומות.

שם קובץ הקלט הוא input.txt. השורה ה-$1$ של input.txt מכילה את מספר התלמידים $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.