900. DistribuNim II

Two players play a game with at least two piles of stones. The players alternately take stones from one or more piles, subject to:

The player that is unable to move loses.

For example, if the piles are of sizes 2, 2 and 4 then there are four possible moves.

(2,2,4)(1,1,0)(1,1,4)(2,2,4)(1,0,1)(1,2,3)(2,2,4)(0,1,1)(2,1,3)(2,2,4)(0,0,2)(2,2,2)

Let t(n) be the smallest nonnegative integer k such that the position with n piles of n stones and a single pile of n+k stones is losing for the first player assuming optimal play. For example, t(1)=t(2)=0 and t(3)=2.

Define S(N)=n=12Nt(n). You are given S(10)=361522.

Find S(104). Give your answer modulo 900497239.

900. 分布式取石子游戏 2

两位玩家用至少两堆石子玩游戏,两人须在遵守如下规则的同时,轮流从一个石堆或者两个石堆中取石子:

首先无法操作的玩家落败。

例如,倘若初始时有各含 2、2、4 枚石子的三个石堆,那么此时先手有四种可行操作:

(2,2,4)(1,1,0)(1,1,4)(2,2,4)(1,0,1)(1,2,3)(2,2,4)(0,1,1)(2,1,3)(2,2,4)(0,0,2)(2,2,2)

t(n) 为满足如下条件的最小非负整数 k:若初始时有 n 个含 n 枚石子的石堆、1 个含 n+k 枚石子的石堆,在两人都以最优策略操作时,先手必败。例如:t(1)=t(2)=0t(3)=2

S(N)=n=12Nt(n)。已知 S(10)=361522

S(104)900497239


这个链接 回到源站。

这个链接 回到详细版题目目录。