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|
Vamsi Krishna Avula:
@cyclops, just wondering what is length of your code for this problem?
Getting TLE in Java. :(
i'm using c#.code runs at Ideone.com, but when submit the solution, it gives runtime error.. Please provide the answer for it. I gave the input values in Ideone.com, when submit the solution there is no place to give the input values.. please give the reply for this.Last edit: 2015-03-26 14:24:05
Got this using JAVALast edit: 2015-03-23 22:46:06
Why aren't single digit numbers considered palindromes? They should be. Mine kept failing until I forced it to output 11 on any single digit.
very good problem :)
I wrote the program and it works fine and gives the results as expected. But still when I submit it here, it says wrong answer.