i am having problem in a program the compiler is showing that the program is executed successfully
and the output to question is also correct but the submission queue is showing it has a run time error pleaze help …
the code is:
PROBLEM CODE:COPS
https://www.codechef.com/viewsolution/28407439
Please either format your code or link to your submission - the forum software has mangled it and it won’t compile!
ahh i dont know how to do it plz tell me
Don’t know how to do what?
Anyway, assuming this is the Submission you were trying to link to, consider the testcase:
1
5 10 5
ahh…its showing 0
Really? For me, it’s showing:
0
0
i have corrected it…bt still its showing error
Good - please link to your most recent submission in future - I’ll do it for you, for now
https://www.codechef.com/viewsolution/28373868
Now, consider the testcase:
1
4 5 2
its showing 1
plz help
its showing wrong answer
my bad,sorry
Yes, I know - I’ve given you a testcase: is your program giving the correct answer for that testcase, and if not, what is the correct answer, and how do you fix your program so that it does give the correct answer for that testcase?
its giving the correct answer
Really? If I have 4 apples and 5 oranges, and can buy two apples/ oranges, the minimum difference between the number of apples and oranges I can obtain is 1
?
my bad sorry
i really interpreted it wrong…
and thanks for ur time
Ah, no problem - it happens
After you’ve fixed that, consider the testcase:
1
1 100 1
thanks a lot sir…
finally i got it