I just submitted 160A - Близнецы , in my compiler "codeblocks" it works perfectly and the initial tests are correct, it retruned wrong answer on test 1 when I submitted so I tested it in the custom test where I'm sure I put the exact same code, it returns wrong answer...
can anyone help me and explain what is the problem here ?
your code is wrong in my compiler too...
You didn't initialize the variable
sum
.Well thank you for correcting, although my code is still a wrong solution . the problem is that I still don't understand why does my compiler gives a different result other than codeforces's compiler...
If you didn't initialize the variable, it can have any value. E.g:
That print might print anything, and it might even be different when you run the same executable twice. It's essentially your fault for writing code that uses the value of an uninitialized variable.
By the way, code::blocks is not a compiler.