ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT > задача:


50912 - Trip to Librazhd

Гость
• Вопросы к жюри (1)

Задачи сборника

• 50740 - Service Time - 1
• 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 - Frekuenca e karaktereve
• 50558 - Hangari i madh [USACO FA...
• 50563 - Modul i gjate
• 50565 - Numra binare
• 50567 - Normalizimi Min Max
• 50569 - Lendet me zgjedhje per kla...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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