JOIN
Get Time
forums  Revision History
Search My Post History  |  My Watches  |  User Settings
Forums Algorithm Matches SRM 534 Re: Help on DIV2 - 500, Revision History (1 edit)
Re: Help on DIV2 - 500, (response to post by jacksuyu)
Ok, I found the error.

It is this line: int nextPlayer = (player + 1) % 2 + 1;

If player = 1, then nextPlayer = 1, which will have you always return true. What you should have had was int nextPlayer = (player % 2) + 1;
Re: Help on DIV2 - 500, (response to post by jacksuyu)
For some reason, you always return "YES".