ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1002. Телефонные номера

Robert Otome A closer look! [7] // Задача 1002. Телефонные номера 21 окт 2008 07:01
Each number maps to several letters of the alphabet. However, notice that several letters map to a single digit. If you can't go to the mountain, bring the mountain to you. Convert the words found in the dictionary for each case into digits, using the given map. Looking up which digit a letter maps to can be done in constant time if you use the right data structure. Then all that is left is to compare against the phone number given.
shako Re: A closer look! // Задача 1002. Телефонные номера 13 июл 2009 13:26
Robert Otome писал(a) 21 октября 2008 07:01
Each number maps to several letters of the alphabet. However, notice that several letters map to a single digit. If you can't go to the mountain, bring the mountain to you. Convert the words found in the dictionary for each case into digits, using the given map. Looking up which digit a letter maps to can be done in constant time if you use the right data structure. Then all that is left is to compare against the phone number given.
Aditya Joshi Re: A closer look! // Задача 1002. Телефонные номера 3 мар 2013 17:12
Wow smart!
BillSu Re: A closer look! // Задача 1002. Телефонные номера 17 апр 2014 13:40
Clever tips. Thanks.
AksCode Re: A closer look! // Задача 1002. Телефонные номера 3 окт 2014 07:20
Great Tip.
Forrest Re: A closer look! // Задача 1002. Телефонные номера 12 июл 2016 08:37
Can't believe!!!! Excellent idea!!!!
Rumi133114 Re: A closer look! // Задача 1002. Телефонные номера 15 окт 2019 13:22
If you can't go to the mountain, bring the mountain to you....wow what a statement!
Ilya Lubashov Re: A closer look! // Задача 1002. Телефонные номера 4 ноя 2019 15:27
nice, but you must check such events:
1) word contains "ij" -> "11"(simple going letter by letter algorythm), that is not right it must transform into "1"( in dict "1":"ij"), but if word contains "ii" it must transform into "11".
2) if one word ends on some digit and another starts on it.
we have words with "18" code and "89" code.
Number "189". It depends, what letters words contain. There three alternatives: take both words, take with "18" or with "89".