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

Обсуждение задачи 1354. Палиндром. Он же палиндром

not only in this problem. what can i use the KMP algorithm for? what kind of problems can i solve?
Dmitry 'Diman_YES' Kovalioff I solved no problems using exactly KMP, but... (+) [2] // Задача 1354. Палиндром. Он же палиндром 1 май 2005 09:21
You can try to solve Ural-1269. The problem is very difficult, use Aho-Corasik algo which is a modification of KMP for several substrings. And there are several problems I solved via finite automatons, in some of them you can use KMP. As for this very problem (Ural-1354) - O(N^2) solution is OK :)
Maigo Akisame (maigoakisame@yahoo.com.cn) Re: I solved no problems using exactly KMP, but... (+) // Задача 1354. Палиндром. Он же палиндром 11 май 2005 12:01
I'd like to know the solution to 1269. I use something I'd call trie-graph, and it works very well for 1158, but it takes up too much memory. Could you teach me the modified version of the KMP algo, or give me a link?
As Dmitry Kovalioff stated before, O(N^2) solution works just fine. I found out empirically that 16 millions of operations fit just fine in one second. By the way, what was the jury idea? Was it really a trap task (seems hard with prefix functions, but quite simple with a little DP)? Or it's simply the time limit turned out to be too big?