CEN112 Questions 2016 |
Старт: 30.мар.2016 в 15:10:22
Финиш: 01.апр.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица
|
|
Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Course Selection
Question:
At the university, there are many courses for students.
The courses have quotas and the students are able
to choose courses if there is a sit in the course.
Write a program that reads course selection list of
n students, and then, list top m courses according
to the number of students chosen.
Input specification
You will be given three integers in the beginning:
- The number of students (n): an integer not
greater than 20,000.
- The quota for the courses (m): not more than
m students can join to the courses
- The number of courses to list (k):
list top k courses.
Then, the following n lines starts with an integer, (k)
the number of preferences of this student.
Then, you will be given
k course codes which are at most 8 char long
alphanumeric text.
The order of students defines the course
selection. The first student
has the highest priority for course selection. etc.
Next student can join to a course, if not m students
before him have selected the respected course.
Output specification:
Show the top k courses in descending order
according to the number of students selected. If
the two courses were selected with the same
number of students, first show the course which
is alphabetically smaller.
Sample Input
5 3 2
2 CEN103 CEN112
2 CEN111 CEN112
3 CEN103 CEN111 CEN211
2 CEN111 CEN211
3 CEN103 CEN111 CEN112
|
Sample Output
CEN103
CEN111
|
Explanation:
There are 5 students.
All the courses have the quota of 3 (each course
can be chosen by at most 3 students).
Then, list top 2 courses.
Course Code |
Number of students applied |
CEN103 |
3 |
CEN111 |
4 |
CEN112 |
3 |
CEN211 |
2 |
But, because the max quota is 3, CEN111
can be selected by at most 3 students. Then, top two
courses according to the alphabetic order CEN103, CEN111.
Для отправки решений необходимо выполнить вход.
|