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

Обсуждение задачи 1102. Странный диалог

For those who dont know how to solve it
Послано Olzhas2dy 12 июн 2007 19:47
Well, here are some hints:
1. Use DFA. If you do'nt know what it is, visit this page http://en.wikipedia.org/wiki/Deterministic_finite_automaton (pay attention to the table of states)

2. use getc() instead of cin>>ch or cin.getch() or whatever you use (for C++/C only)

3. Try this:
3
outputoutputinputon

inputone

Edited by author 13.06.2007 17:36
Re: For those who dont know how to solve it
Послано Boris Strandjev 19 окт 2007 19:47
I would recommend using gets() for all that want to have the whole string at once. It still is fast enough and does not time limit.
Re: For those who dont know how to solve it
Послано Entheogen 14 ноя 2007 05:12
How exactly do you use DFS for this?  Can you provide an example of some other problem similar to this which is solvable by DFS?  Thank you.
Re: For those who dont know how to solve it
Послано Romko [Lviv NU] 14 ноя 2007 17:52
It's Not DFS problem!!!!! It's DFA(Deterministic finite automaton) problem!
Re: For those who dont know how to solve it
Послано [SPbSU ITMO] Kazakov Sergey (CK.) 18 апр 2008 21:08
I solved it with DFS in 0.453 sec.
Re: For those who dont know how to solve it
Послано PersonalJesus 24 июн 2008 21:06
When I was using STL, I always had TL on the first test but I was sure that this is the correct algo. Then I replaced all STL's strings with array of chars and I got ACC 0.078 . OMGWTF ?!
Re: For those who dont know how to solve it
Послано Mahilewets 11 май 2017 16:41
First test is really large.  Something of order 1e6.
Re: For those who dont know how to solve it
Послано guilty spark 5 авг 2021 21:55
Its a simple substring search problem.