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

Обсуждение задачи 1842. Локальные корни

What algo?
Послано bsu.mmf.team 25 авг 2016 18:13
Finally I've solved this problem using very hard optimised Main & Lorentz's algo, and 0.405s only.

But I noticed many people solved this problem very fast and using much less memory.
What algo do you use? I doubt it's possible to speed-up Main & Lorentz or Crochemore algos so much.

Is it some alternative (like suffix tree) solution, or just some strong idea can be applied to this particular problem? Is it possible to solve it in O(n)?
Re: What algo?
Послано Shen Yang 24 фев 2017 14:56
I use something similar with manacher algorithm with some optimization..
Re: What algo?
Послано Shen Yang 25 фев 2017 09:59
I use this approach:

first for every position find the answer which cover outside the string(using kmp algo) as

estimate value,  and sort the estimate value in desending order, then use

bruteforce(hash+enum) to calc the answer inside the string.when estimate value <=ans break;

this program make me 0.2s AC...
Re: What algo?
Послано bsu.mmf.team 13 апр 2017 01:55
Thank you, but your solution is either not very fast :)
I believe there's a strict approach exists with a strict algo for this problem.
Re: What algo?
Послано Celebrate 27 окт 2021 16:44
My algorithm is similar to Shen Yang.But I also use exkmp to calc another two situaion.
Then the estimate value will become smaller.I got AC in 0.046s.
Re: What algo?
Послано winger 18 апр 2024 22:03
Look up Critical Factorization Theorem