ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1732. Ministry of Truth

TLE 9
Posted by catalin_oancea 9 Apr 2011 20:53
I use KMP algorithm but i've got TLE at #9
my code is:
[code deleted]

what can I improve? How did you solve-it?

Edited by author 09.04.2011 20:54
Re: TLE 9
Posted by bsu.mmf.team 11 Apr 2011 03:21
You don't need KMP in this task. I can't even image how this algo helps to solve it. The solution is much more simple. Just find the least position for every word. I got AC even with std::string and the function str.find()
Re: TLE 9
Posted by catalin_oancea 12 Apr 2011 21:46
Can you give me an example?  How to use str.find() in c++? My email adress is catalin_oancea2008@yahoo.com

Edited by author 12.04.2011 21:46
WA 9
Posted by Zhandos 13 Apr 2011 12:17
I have Wa 9. Can anybody help me ?
Re: WA 9
Posted by catalin_oancea 13 Apr 2011 19:50
try this:

in:
===========================

hhahaphapphappyhappyhh
hap happ hh

out:
===========================

___hap____happ______hh
Re: WA 9
Posted by inatial_D 6 Feb 2013 20:57
this test helps me to find a bug. thanks.