Game Theory Problem [2018 ICPC Singapore Online Contest]

Правка en1, от john_hopes, 2018-09-19 09:59:13

Is there anyone can help me to solve this problem?

Problem Link: https://open.kattis.com/problems/foolingaround

Problem Description:

Alice and Bob take turns playing a game, with Alice going first. They begin with a pile of N stones, each turn removing one less than a prime number of stones. The person who removes the last stone wins. Given N, determine who wins the the game.

Constraints: N>0 and N<=10^9

I already read some solutions. They just pre calculated all the N for which Second Player wins and answer each query.

How can I pre calculate all the N(Second Player wins)?

Теги game theory

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский john_hopes 2018-09-19 09:59:13 664 Initial revision (published)