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

Discussion of Problem 1297. Palindrome

O(N^2) idea, works fine
Posted by Marian Darius 21 Dec 2012 16:51
4686044    16:50:13   21 Dec 2012    Marian Darius    1297. Palindrome    C++    Accepted      0.031    108 KB

Just try iterating the middle of the palindrome and extend to both ends, until you find two elements that are different.
Re: O(N^2) idea, works fine
Posted by Andrew Sboev [USU] 21 Dec 2012 21:57
Are you really think that you are the first who do it for O(N^2) with the same idea? And it's not the first topic in the forum about this algo.
Re: O(N^2) idea, works fine
Posted by Dhruv Somani 3 May 2016 22:00
I don't know why but I get a TLE in #15 with the same approach as yours.