HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


Trip to Librazhd

Volume problems

• 50928 - War Of Battleships
• 50930 - Tom and Jerry
• 50925 - Optimizing Elevator Usage
• 50988 - Laplacian Filter
• 50747 - Safe boxes against thieves
• 50742 - King Arthur II
• 50791 - Mine field
• 50912 - Trip to Librazhd
• Trip to Librazhd
• 50914 - Buy 3, Pay 2
• 50555 - Frequency of Letters
• 50558 - Biggest Barn
• 50563 - Long Modulus
• 50565 - Binary numbers
• 50567 - Input Data Normalization
• 50569 - 12th Grade Elective Subjects
• 50585 - Inner Product

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