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 บรรทัดที่ $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.