World's largest Contributor driven code dataset | Used in Quark Search Engine, @OpenGenus IQ, OpenGenus Visual Project
GNU General Public License v3.0
13.58k
stars
3.69k
forks
source link
Codechef NUMGAME2 in C #5106
Open
ritish099 opened 4 years ago
This is a(n):
Details:
Alice and Bob play the following game.They choose a number N to play with.The runs are as follows :
1.Bob plays first and the two players alternate.
2.In his/her turn ,a player can subtract from N any prime number(including 1) less than 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 ?