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

Обсуждение задачи 1713. Ключевые подстроки

=(
Послано Dima Kravtsov 11 окт 2009 21:45
Please, give me some hints on how to solve it. Thanks in advance.
Re: =(
Послано Vedernikoff Sergey (HSE: АОП) 12 окт 2009 23:35
Hash rulezz =)
Re: =(
Послано Igor9669(Tashkent IAC) 12 окт 2009 23:57
I also use hash,but TLE 3 =(
My complexity is O(N*MaxLen^2*logN).
What is your?

Edited by author 13.10.2009 00:06
Re: =(
Послано Victor Barinov (TNU) 13 окт 2009 15:47
Try use hash table to avoid logN
Re: =(
Послано Vedernikoff Sergey (HSE: АОП) 14 окт 2009 16:55
My complexity is O(N^2*M^2*(logN+logM)), where M is maximal length of a word. It passes TL due to small constant.

P.S. You don't need hash tables to avoid N. Just one linear hash and sorting.

Edited by author 14.10.2009 20:41
Re: =(
Послано Igor9669(Tashkent IAC) 16 окт 2009 12:41
Thanks to all!!!
Re: =(
Послано Petr Nikishin 5 апр 2010 07:58
This problem can be very simply solved using standard techniques of suffix array + lcp array. Complexity is O(N * M * logN), M - length of the longest string. Due to all-round using of STL my solution works in 0.25, but this time can be hugely improved.
SkorKNURE

Edited by author 05.04.2010 08:00
Re: =(
Послано xurshid_n 15 янв 2012 23:01
Petr Nikishin писал(a) 5 апреля 2010 07:58
This problem can be very simply solved using standard techniques of suffix array + lcp array. Complexity is O(N * M * logN), M - length of the longest string. Due to all-round using of STL my solution works in 0.25, but this time can be hugely improved.
SkorKNURE

Edited by author 05.04.2010 08:00

You are right! I Ac! 0.046 s. Thanks!
Re: =(
Послано Mahilewets 11 июл 2017 16:21
(N^2)*(M^2)*(logN+logM)?
When N=1e3 and M=1e2?
Accepted?
Anybody knows how it was done?


Edited by author 11.07.2017 16:23
Re: =(
Послано Mahilewets 11 июл 2017 18:06
So,  I understood
If explicitly sort suffixes of string command1+command command2+command3+...  we have upper bound N^2*M^2 but actual number of comparisons is smaller