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

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

bsu.mmf.team What algo? [6] // Задача 1842. Локальные корни 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)?
Shen Yang Re: What algo? [3] // Задача 1842. Локальные корни 24 фев 2017 14:56
I use something similar with manacher algorithm with some optimization..
Shen Yang Re: What algo? [2] // Задача 1842. Локальные корни 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...
bsu.mmf.team Re: What algo? [1] // Задача 1842. Локальные корни 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.
Celebrate Re: What algo? // Задача 1842. Локальные корни 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.
winger Re: What algo? // Задача 1842. Локальные корни 18 апр 2024 22:03
Look up Critical Factorization Theorem
reshke Re: What algo? // Задача 1842. Локальные корни 10 июн 2025 22:26
Lookup Two Way algorithm for finding critical position of string. Second number is period of the string.