Блог пользователя ndstab

Автор ndstab, история, 2 месяца назад, По-английски

Here's the problem : Bitwise Balancing Here's my submission for the code : Code for the problem

The thing is it gives Wrong Answer on Test 11 and that too on the 2577th case in the 11th test. How are we supposed to debug in these situations when I've practically no idea what is the issue.

P.S. : Please help me find any issues with the code. Greatly appreciated!

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

»
2 месяца назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

You can run your solution on thousands of little test cases locally. From the message you saw, you already know that you sometimes print a number that is not a solution to the equation.

So, write another program that generates valid test cases and a script to run your solution on all these test cases. Add an assert to check that the number you are about to print satisfies the equation. You'll find a small test case that way.