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

×

[closed] Help me in BUGCAL

Hello, I was practicing problems of the Beginner Section, and I have tried to submit a solution for the following problem:-

Problem : https://www.codechef.com/problems/BUGCAL

And My Latest Solution : https://www.codechef.com/viewsolution/16428424

In the IDE this solution ran successfully and I think that I have taken care of all the constraints but somehow the solution is still not accepted. Can please somebody point where and what I am doing wrong or missing out.

And for the Subtask #1 (30 points): 1 ≤ a, b ≤ 9 should the answer be 0 if a=1 and b=9? It would be helpful if somebody answers this.

Thank You

asked 03 Dec, 13:37

darkstark_9000's gravatar image

0★darkstark_9000
01
accept rate: 0%

closed 06 Dec, 20:04

vijju123's gravatar image

4★vijju123 ♦
11.3k1316

The question has been closed for the following reason "The question is answered, right answer was accepted" by vijju123 06 Dec, 20:04


Leading zeroes are not allowed. Meaning-

15+91 =06=6

06 is rejected, 6 is accepted.

Take care of leading zeroes and you're good to go. It is one of the tougher beginner problems.Yes, for 9+1 it is 0.

I see you got wrong output on subtask 1. Try on tricky cases of 5+5, 6+4,9+9 etc. I think it shouldnt be that hard to debug, just give T=10 and try the possible combinations.

PS: Your code fails here-

Input
1
2 8
Your Output
10
Expected Output
0
link

answered 03 Dec, 14:34

vijju123's gravatar image

4★vijju123 ♦
11.3k1316
accept rate: 18%

edited 03 Dec, 14:43

thanks for answering and it helped my solution finally got accepted with 100pts.

(06 Dec, 12:57) darkstark_90000★

For input

1

55 55

Output should be 0

But your code produces 100 as output

link

answered 03 Dec, 14:40

sagijagadish's gravatar image

3★sagijagadish
302
accept rate: 25%

You really mentioned an important point about this input case. I tried this input, found the fault and corrected it and it was accepted. Thanks.

(06 Dec, 12:58) darkstark_90000★

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:

×1,980
×1,155
×846

question asked: 03 Dec, 13:37

question was seen: 145 times

last updated: 06 Dec, 20:04