You are not logged in. Please login at www.codechef.com to post your questions!

×

Wrong answer for PALIN

The Next Palindrome

My code: http://www.codechef.com/viewsolution/2362069

I have tested my code for many cases on my computer and it gives correct answer for all of them, but the online judge is not accepting it. Can somebody help me find the error in this code? Please tell me if you know some tricky test cases which are likely to make people get wrong answers.

I think the online judge should tell us which test case is giving wrong answer.

Some test cases I tried and their answers:

  • 1122334455667788998877665544332211 1122334455667789009877665544332211
  • 1 2
  • 9 11
  • 999 1001
  • 9999 10001
  • 120 121
  • 121 131
  • 122 131

asked 12 Jul '13, 16:32

sharmaeklavya2's gravatar image

5★sharmaeklavya2
139238
accept rate: 0%

edited 12 Jul '13, 16:40


Your code is not working for 9s, see http://ideone.com/x2XQl2

link

answered 12 Jul '13, 17:48

betlista's gravatar image

3★betlista ♦♦
16.9k49115225
accept rate: 11%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,331
×2,284
×704
×214
×190
×53

question asked: 12 Jul '13, 16:32

question was seen: 1,411 times

last updated: 12 Jul '13, 17:48