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

Турниры > CEN112 Homeworks 2013-2015 > задача:


15-SprPr2-60. 50766 - Word Puzzle

CEN112 Homeworks 2013-2015

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

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

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

• 14-Spr2-40. 50361 - Align Two Lists
• 14-Spr2-50. 50616 - Змейка
• 14-Spr2-60. 50444 - n digit kth nu...
• 15-SprHW-20. 50446 - Snake
• 15-SprHW-30. 50788 - Eight Puzzle
• 15-SprHW-40. 50746 - Most Visited
• 15-SprHW-60. 50516 - Lines
• 15-SprPr2-20. 50509 - Reading Book
• 15-SprPr2-60. 50766 - Word Pu...
• 15-SprPr2-80. 50786 - Top Question
• 15-SprPrE1-20. 50785 - Swimming ...
• 15-SprPrE1-40. 50748 - Gold Store
• 15-SprPrE1-70. 50507 - Sequential ...
• 15-SprResit-20. 50447 - Swimming ...

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

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

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

Word Puzzle

On a TV program there is word puzzle game. The competitors are given several words and they are given another word whose letters are scrambled. They are asked to find the word in the shortest time. In order not to have any problem in competition time, the program coordinator is asking a program that verifies the words.

Question: You will be given n words and a word whose letters are scrambled, write a program that will find the correct word. If there are several words with the same letters show the first one. The letters may be uppercase or lowercase, it doesn't make any difference. If both words have the same letters they are assumed to be the same and you don't need to count the spaces. You just check if both words have the same letters or not.

Input specification
You will be given one integer in the beginning, the number of words (n) where 1 ≤ n ≤ 1,000. Then in the second line, you will be given target string which is at most 250 characters containing only 26 English letters and spaces. Then, in the following n lines, you will be given n strings.

Output specification
Show the position of the correct word.

Sample Input I
9
ea lCMbtea
Reshat Tarba
Caleb Meta
Olgers Karini
Xhorxho Uka
Xhoxhina Balukja
Kim Cjapi
Elmedin Dosari
Zhaneta Kruja
Alexander Cox
Sample Output I
2


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

www.contester.ru