MostafaUsama's blog

By MostafaUsama, history, 6 years ago, In English

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 ?

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
← Rev. 3  
Vote: I like it 0 Vote: I do not like it

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

Try to format your code properly.

Formatted
Corrected
»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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.