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

Обсуждение задачи 1486. Одинаковые квадраты

WA#10
Послано Artem Khizha [DNU] 26 янв 2011 03:53
At the moment my way is to look through all the squares of length LEN (using binary search) and to check, whether a hash of a square was met before. It is of O(N*M*log(min{N, M})) complexity.
But I get WA#10 again and again. Please, if someone had a problem with this test, share your impressions, 'cause I'm going slightly mad.
Re: WA#10
Послано Kenny_HORROR 28 янв 2011 21:17
You have a collisions with hash. (I've got this problem also because second number x was to small and close to first one).
Re: WA#10
Послано Artem Khizha [DNU] 5 июл 2012 16:29
Thank you, it really had to do with collisions. Actually, my self-made hashset implementation was fantastically awful. :-)

Edited by author 06.07.2012 15:48
binary search
Послано Anwar 17 сен 2018 18:51
Why you have used binary search? How we can say that the sq. matrix 2x2 has less value than 3x3. and 3x3 has less than 4x4. how can we justify?
Re: binary search
Послано InstouT94 11 дек 2024 16:38
We run a binary search on the length of the square's side. For a fixed length of the square's side, we calculate the hash of all squares with that side length, and look for a pair of squares with the same hash.