HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN112 Questions 2016 > problem:


15-MdtE-1. 50915 - Trip to Korca

CEN112 Questions 2016

Start: Mar.30.2016 at 03:10:22 PM
Finish: Apr.01.2016 at 05:00:00 AM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (3)

Contest problems

• 15-FE-4. 50995 - Group Average
• 15-FE-6. 50989 - Rectangles and Points
• 15-FE-7. 50990 - Two Neighbors
• 15-FE-8. 50991 - Intersecting Circles
• 15-HW-2. 50932 - Shifting rows and...
• 15-HW-3. 50933 - Sum of the Bigges...
• 15-HW-4. 50934 - Selling Cars
• 15-HW-5. 50935 - Max Discount
• 15-MdtE-1. 50915 - Trip to Korca
• 15-MdtE-2. 50916 - Ascending Num...
• 15-MdtE-3. 50913 - Manhattan Distance
• 15-MdtE-4. 50917 - Descending Nu...
• 15-MdtE-5. 50912 - Trip to Librazhd
• 15-MdtE-6. 50914 - Buy 3, Pay 2
• 15-PE-1. 50865 - Apartment Building...
• 15-PE-2. 50866 - Buy the cheapest
• 15-PE-4. 50868 - Sort Frequencies

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Trip to Korca

Question: TraveLovers club is organizing a trip to Korca. You have the full students list. Then, you will be given m student IDs who are participating to the trip. Show sorted list of participating students according to department codes. If there are several students from the same department, show students according to grade attending (and name, then surname) in ascending order.

Input specification
You will be given two integers in the beginning: the number of students (n) and the number students (m) who are participating to the activity. Then, in the following n lines you will be given n student information which is sorted according to IDs:

  • Student ID: an integer not greater than 500,000
  • Name and surname: at most 15 chars strings (separated by a space)
  • Department code: at most 5 chars string (some possible codes are CEN, ECE, BINF, etc.)
  • Grade attending: integer between 1 and 5 where 1 means first grade (year) student, etc.
where 0 ≤ m ≤ n ≤ 40,000.

Output specification:
Show department, grade, name and surname of the students who are participating.

Sample Input I
10 5
4 Dominic Allison BINF 1
7 Moses Mendez CEN 4
9 Alison Burns CEN 3
13 Marilyn Patterson ECE 3
18 Jean Bass BINF 4
20 Cora Duncan ECE 3
24 Marta Roberson BINF 3
25 Jill Flores ECE 1
28 Carla Holmes CEN 2
32 Mike Johnston ECE 1
20 7 32 13 9
Sample Output I
CEN 3 Alison Burns
CEN 4 Moses Mendez
ECE 1 Mike Johnston
ECE 3 Cora Duncan
ECE 3 Marilyn Patterson



Для отправки решений необходимо выполнить вход.

www.contester.ru