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

Обсуждение задачи 1563. Баяны

WA 7 Hashing
Послано Gio Pataraia [Tbilisi SU] 25 апр 2011 02:15
i'm trying to solve this with hashing but i got wa on 7test..
i take max hash number 100000001..
is't possible that two different strings hash is equal?
Re: WA 7 Hashing
Послано AterLux 25 апр 2011 13:52
of course it possible that different data has equal hash.
for example, if you calculating hash by simple adding char codes, then strings "abc" and "cba" and "acb" etc. - will have equals hash.

But if you're lucky enough and chosen good hash formula, all tests can be passed, even though youre solution actually will be wrong and may give wrong answers on special (designed to your hash formula) tests.
Re: WA 7 Hashing
Послано Gio Pataraia [Tbilisi SU] 27 апр 2011 03:55
thanks, my formula was absolutly correct, there was some mistake in comparing to other hashes :)