Matrix.code's blog

By Matrix.code, 9 years ago, In English
It is two player(Alice ,Bob : Alice to play first)  impartial game. N empty pillar is given an An integer L ,Initially , a set S contains all element from 1 to L . 
In each turn
1 . A player chooses an integer from set S.
2. A player chooses an empty pillar(if any), put the number , erase it from The set
3. A player chooses a non-empty pillar, But (The integer + last number inserted on that pillar) should be a square number. , erase the number.

Example : If a pile contain 1 as the last inserted number, A player can insert 3,8,15 …. 

The player who can not play his/her turn loses.

N , L is given , Determine who will win if they play optimally..

N <= 10^3 , L = 10^9
  • Vote: I like it
  • -4
  • Vote: I do not like it