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


Ceil and A-B problem

After soving the problem Ciel and A-B Problem i checked the best submissions in C lang. and found that these submissions fail the basic test case which states that A-B should not be equal to A. these are the code I am talking about.For i/p 6 1 o/p is 6. still the solution is accepted? I am confused...

asked 15 Oct '14, 23:32

rdfan19's gravatar image

accept rate: 25%


1 ≤ B < A ≤ 10000 Sample Input

5858 1234 Sample Output

1624 Output details

The correct answer of 5858-1234 is 4624. So, for instance, 2624, 4324, 4623, 4604 and 4629 will be accepted, but 0624, 624, 5858, 4624 and 04624 will be rejected.

copied this from problem page,it says 5858 will be rejected which is the A

(16 Oct '14, 22:38) rdfan193★

Who told you that? Ciel gives a wrong answer. You have to just change one digit in the actual answer and print it out! So how does that, A-B ! =A come into picture? 6-1 =5 should be the actual answer, but you can change one digit and make it 6. So that makes 6 a valid output. Have you misunderstood the problem statement a bit?


answered 16 Oct '14, 08:46

pranjalranjan's gravatar image

accept rate: 20%

hey pranjal ... i thot the same as u bt look above the example given .. it is saying 5858 - 1234 , cannot give 5858....!!!!

the case of 5858 as answer has been rejected


answered 25 Jan '15, 11:54

keshav_1994's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 15 Oct '14, 23:32

question was seen: 921 times

last updated: 25 Jan '15, 11:54