Correct output but wrong answer

i don’t know whats wrong with my code i am getting wrong answer
here is link of my solution “Solution: 56814050 | CodeChef
i am beginner to this plz help!

Consider the test input:

113 1000 0 1
1 Like

Should it be a “YES” or “NO” ??

It should be a YES.

1 Like

Can you suggest me what’s wrong with my code ??

I could, but I’m not going to :stuck_out_tongue:

You’ve got a 100% reproducible test case - get debugging :slight_smile:

Maybe start by printing the value of b at the beginning of each iteration of the while loop, when given the above test input - that might tell you what’s going wrong.

1 Like