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
time limit exceeded :( But it takes only 0.2 secs in ideone
Hrithik, you can use a static array to handle big numbers in c/c++.
how can we make any code to work for large input numbers ?? in cpp
have everyone tried test inp 999 out 1001
i have taken more than 100 test cases ..all of them paased but here it is showing wronf answer
what does this error code mean "runtime error (NZEC)" . My code is working on "ideone" but not here. i have written my code in c#.
What happens if input integer is written with the beginning zero(s)? For example: 01010
please upgrade your fucking compilers in c atoi not working!
For those getting wrong answer it is probably because your code wont work for a large( e.g. : 100 )digit number
check for the following: