- You manage to block you opponent.
- 72
Statement
Objectif
You will play a game that has a winning strategy and against a boss who knows the winning strategy. Your goal is to find this strategy in order to win.
Hint : You can see the Sprague-Grundy theorem.
Hint : You can see the Sprague-Grundy theorem.
Rules
You will play on a grid.
On each row, each player has a token of his color that he can move only in direction of the opponent's token of this row (it can't move back) without going beyond. In other words, when the two tokens of a row are side by side, no more move is possible for this row.
Each player plays in turn only one token.
If a player can't play anymore, he loses.
You always begin and start on a winning position.
On each row, each player has a token of his color that he can move only in direction of the opponent's token of this row (it can't move back) without going beyond. In other words, when the two tokens of a row are side by side, no more move is possible for this row.
Each player plays in turn only one token.
If a player can't play anymore, he loses.
You always begin and start on a winning position.
Victory conditions
Loss conditions
- You can't play anymore.
- You do not respond in time or output an unrecognized command.
Input
Initial input
Line 1 : The number rows of lines.
Line 2 : The number columns of columns.
Line 2 : The number columns of columns.
Input for one game turn
For each game turn, in a loop for each row you have :
The position xPlayer of your token followed by the position xBoss of your opponent's token.
The numbering starts at0 .
The position xPlayer of your token followed by the position xBoss of your opponent's token.
The numbering starts at
Output for a game turn
Line 1: 2 integers separated by a space row and newX corresponding to the row of the moved token and to it's new position on this row.
Constraints
Response time per turn ≤
A higher resolution is required to access the IDE