HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > ProgramHER 2019 > problem:


2. Trip to Librazhd

ProgramHER 2019

Start: Mar.03.2019 at 09:59:00 AM
Finish: Mar.03.2019 at 12:54:00 PM
The contest is finished!
• Contest scoreboard

Contest problems

• 1. Word Puzzle
• 2. Trip to Librazhd
• 3. Check-Mate
• 4. Post Office Delivery

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 Sidrit Reka and Ibrahim Mesecan.

Trip to Librazhd

Question: University is organizing a trip to Librazhd. You have the students list. And, you will be given m student IDs who are not participating to the trip. After the removal of given students, show sorted list in ascending order according to grade attending and names (and surnames).

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

  • Student ID: an integer not greater than 100,000
  • Name and surname: at most 15 chars strings (separated by a space)
  • Grade attending: an integer between 1 and 5
  • Gender: a single char 'f' or 'm'
The last line contains m integers: the IDs of the students who are not participating to the trip. where 0 ≤ m ≤ n ≤ 40,000

Output specification:
Show grade, name & surname of the students who are participating (in the order given above).

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



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

www.contester.ru