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

Турниры > IMPC - 2013-2014 > задача:


2013-04-100. 50323 - Filtering Contact List

IMPC - 2013-2014

Старт: 16.мар.2013 в 12:00:00
Финиш: 16.мар.2013 в 17:00:00
Турнир завершён!
• Турнирная таблица

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

Задачи турнира

• 14-07-20. 50384 - Permutations revi...
• 14-07-30. 50385 - The 3n + 1 problem
• 14-07-50. 50367 - Bar Codes
• 2013-03-10. 50579 - Numrat pentag...
• 2013-03-20. 50589 - Numri i vezeve...
• 2013-03-30. 50559 - Faktoret e thje...
• 2013-03-40. 50685 - Perdorimi i dh...
• 2013-04-10. 50335 - Five Math Ope...
• 2013-04-100. 50323 - Filtering ...
• 2013-04-30. 50337 - Exam Averages
• 2013-04-40. 50338 - Convert Into ...
• 2013-04-50. 50774 - Hot Potato
• 2013-04-70. 50296 - Total Discount...
• 2013-04-80. 50343 - The number of...
• 2013-04-90. 50332 - Variance of a ...
• 2013-05-10. 50552 - Kepuce te perd...
• 2013-05-30. 50580 - Sa dite kane ka...

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

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

Лимит времени 4000/7000/7000/7000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by Ibrahim Mesecan.

Filtering Contact List

You are working in a mobile service operator. The company gives a special service to its clients and stores the contact lists for the clients on its servers. The chief of department wants you to write a program to filter the contacts when the client presses some filter keys on his phone.

Every filter number represents several characters from the alphabet:

  • 2 ==> A, B, C
  • 3 ==> D, E, F
  • 4 ==> G, H, I
  • 5 ==> J, K, L
  • 6 ==> M, N, O
  • 7 ==> P, Q, R, S
  • 8 ==> T, U, V
  • 9 ==> W, X, Y, Z
If 2 is pressed at the beginning of filter number, any contact starting with A, B or C will be listed.

Write a program that is going to filter the contact list according to the given filter number.

Input specification
You are first given two numbers (n and filterNum) where 1 ≤ n ≤ 100 and 1 ≤ filterNum < 107. Then, you are given n names which are at most 12 characters long.

Output specification
Show names one in every line which are filtered according to the given key series. Show the names in increasing order from A to Z. If no name fits to the given criteria, show the message "No results found"

Sample Input:
  6 35
  Mehmet
  Florenc
  Ahmet
  Ibrahim
  Elton
  Mustafa

Sample Output:
  Elton
  Florenc

Output Explanation:

  • The first char is 3. That means any name starting with D, E or F. And
  • The second char is 5. That is any of the filtered names whose second char is J, K or L.


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

www.contester.ru