- #1
Avichal
- 295
- 0
Puzzles like the following(they are actually programming questions) :-
How do you solve such puzzles?
Since they say that both play optimally does that mean given the conditions in the game(here let's say number N is given) we already know who will be the winner?
codechef said:Alice and Bob play the following game. They choose a number N to play with. The rules are as follows :
1) Alice plays first, and the two players alternate.
2) In his/her turn, a player can subtract from N any proper divisor (not equal to N) of N. The number thus obtained is the new N.
3) The person who cannot make a move in his/her turn loses the game.
Assuming both play optimally, who wins the game ?
codechef said:Alice and Bob play the following game : There are N piles of stones with Si stones in the ith pile. Piles are numbered from 1 to N. Alice and Bob play alternately, with Alice starting. In a turn, the player chooses any pile i which has at least i stones in it, and removes exactly i stones from it. The game ends when there is no such pile. The player who plays last wins the game. Assuming Alice and Bob play optimally, who will win the game?
How do you solve such puzzles?
Since they say that both play optimally does that mean given the conditions in the game(here let's say number N is given) we already know who will be the winner?