Sunday 5 March 2017

Younger Brother[CODECHEF] : Grundy Number


GRUNDY NUMBER

The game consists of C boards. Each board i is a grid of dimension ni x mi.

Rules of the game:

- A coin is placed at (1,1) on every board initially.

- Each one takes a turn alternatively.

- In one turn, a player can choose any one board and move a coin from a cell (i,j) to one of the following cells:

(i+1,j) OR (i+2,j) OR (i,j+1) OR (i,j+2) OR (i+1,j+1) OR (i+2,j+2).

- A coin cannot be moved out of the board at any point during the game.

- A coin cannot be moved once it reaches the cell (n,m) where n and m are the dimensions of the board of that coin.

- A player MUST make one valid move.


Problem Link
faster Solution




View Ramesh Chandra's profile on LinkedIn

Ramesh Chandra

No comments:

Post a Comment