Sorting Bank Account, spoj, WA

I am solving SPOJ.com - Problem SBANK and I don’t understand why do I keep getting WA. I have looked for solutions but I see people have solved it using maps. I am solving this problem using C, so using maps is out of question.Also, I don’t think it’ll be fun to solve this using maps. I just want to know the case that I am failing, so that I can correct it and optimize it later, if necessary.

Thank you.

code: x63tZV - Online C Compiler & Debugging Tool - Ideone.com

Brother try this one : OJJSnd - Online C Compiler & Debugging Tool - Ideone.com

4 Likes

Hi dude, I could spot one error (number of zeros)


Please see this link(your code and the test case)
Your solution . It is printing extra zeros. Also, this site could be helpful to you in detecting WA’s–>
Spot Toolkit

5 Likes

Thanks a lot :slight_smile: Anyway, can you spot what was I doing wrong?

Thanks a lot! :slight_smile: