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

Автор MostafaUsama, история, 6 лет назад, По-английски

80274618 1352B - Same Parity Summands

can someone help me please i dont know what is wrong

When i copy the input to my compiler the program stops and closes suddenly after reaching a high number of test

how can i solve this ?

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

»
6 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Your code is not well-formed.It's hard to read and debug.

Try to format your code properly.

Formatted
Corrected
»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

You have for (int i = 0; i < x; i++) and for (int i = 0; i < z-1; i++) inside that, so i gets incremented multiple times inside the loop. Once it's more than x, your code stops.

The Unexpected end of file happens because your code didn't output answers to all the test cases, and the checker finds an EOF instead of your answer.

To avoid this error in the future, you can create a void solve() function to handle each individual test case. It also helps with code readability when debugging.