You are not logged in. Please login at www.codechef.com 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. http://www.codechef.com/viewsolution/1844100 http://www.codechef.com/viewsolution/1943632 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

3★rdfan19
242
accept rate: 25%

Constraints

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?

link

answered 16 Oct '14, 08:46

pranjalranjan's gravatar image

4★pranjalranjan
2.0k21432
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

link

answered 25 Jan '15, 11:54

keshav_1994's gravatar image

0★keshav_1994
115
accept rate: 0%

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:

×690
×239
×10
×7
×6

question asked: 15 Oct '14, 23:32

question was seen: 921 times

last updated: 25 Jan '15, 11:54