PALIN - The Next Palindrome
A positive integer is called a palindrome if its representation in the decimal system is the same when read from left to right and from right to left. For a given positive integer K of not more than 1000000 digits, write the value of the smallest palindrome larger than K to output. Numbers are always displayed without leading zeros.
The first line contains integer t, the number of test cases. Integers K are given in the next t lines.
For each K, output the smallest palindrome larger than K.
Warning: large Input/Output data, be careful with certain languages
|Added by:||Adrian Kosowski|
|Cluster:||Cube (Intel Pentium G860 3GHz)|
|Languages:||All except: NODEJS PERL 6 SCM chicken|
All sorts of test cases checked but still getting a WA, can anybody pls check?
i have fallen into the "i have every test correct but still WA" club...
How many test cases max? Is it mentioned anywhere?Last edit: 2015-05-19 11:46:04
How can I "like" this problem ?
finally got it right!
9 4 1 8 7 9 7 8 3 2 2------------>9 4 1 8 8 0 8 8 1 4 9
Finally! Got it right!! I feel like I should get a trophy for this. :)
Hi, on all colected in comments cases I get correct answer but still I get WA in jugde system. (see: http://ideone.com/ufyoiZ )
For the below input it took 0.002547891 sec
Can anyone really give me input for which my time limit will get exceeded. my java program in ideone is https://ideone.com/BmRqah