freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-325-stone-game-ii.md

51 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f4b11000cf542c50ffc4
title: 问题325石头游戏II
challengeType: 5
videoUrl: ''
dashedName: problem-325-stone-game-ii
---
# --description--
一场比赛是用两堆石头和两个球员进行的。在轮到她时,玩家从较大的堆中移除了许多石头。她移除的石头数量必须是较小桩中石头数量的正数倍。
例如让有序对6,14描述一个配置在较小的桩中有6个石头在较大的桩中有14个石头那么第一个玩家可以从较大的桩中移除6或12个石头。
从一堆中取出所有宝石的玩家赢得比赛。
获胜配置是第一个玩家可以强制获胜的配置。例如1,52,63,12是获胜配置因为第一个玩家可以立即移除第二堆中的所有宝石。
失败的配置是第二个玩家可以强制获胜的配置无论第一个玩家做什么。例如2,33,4正在失去配置任何合法移动都会为第二个玩家留下获胜配置。
将SN定义为所有丢失配置xiyi的总和xi + yi0 <xi <yi≤N。我们可以验证S10= 211和S104= 230312207313。
找到S1016mod 710。
# --hints--
`euler325()`应该返回54672965。
```js
assert.strictEqual(euler325(), 54672965);
```
# --seed--
## --seed-contents--
```js
function euler325() {
return true;
}
euler325();
```
# --solutions--
```js
// solution required
```