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

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

A closer look!
Послано Robert Otome 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.
Re: A closer look!
Послано shako 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.
Re: A closer look!
Послано Aditya Joshi 3 мар 2013 17:12
Wow smart!
Re: A closer look!
Послано BillSu 17 апр 2014 13:40
Clever tips. Thanks.
Re: A closer look!
Послано AksCode 3 окт 2014 07:20
Great Tip.
Re: A closer look!
Послано Forrest 12 июл 2016 08:37
Can't believe!!!! Excellent idea!!!!
Re: A closer look!
Послано Rumi133114 15 окт 2019 13:22
If you can't go to the mountain, bring the mountain to you....wow what a statement!
Re: A closer look!
Послано Ilya Lubashov 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".