Files
freeCodeCamp/curriculum/challenges/japanese/10-coding-interview-prep/project-euler/problem-310-nim-square.md

47 lines
1.0 KiB
Markdown
Raw Permalink Normal View History

---
id: 5900f4a21000cf542c50ffb5
title: '問題 310: ニム平方数'
challengeType: 5
forumTopicId: 301966
dashedName: problem-310-nim-square
---
# --description--
アリスとボブが「ニム平方数」というゲームをします。
ニム平方数は、3 つの石の山を使う通常のニムと似ていますが、プレイヤーは 1 つの山から平方数個の石を取らなければなりません。
3 つの山に積まれた石の数を、3 つの数の順序組 ($a$ $b$, $c$) として表します。
$0 ≤ a ≤ b ≤ c ≤ 29$ の場合、次のプレイヤーが負けるポジションは 1160 個あります。
$0 ≤ a ≤ b ≤ c ≤ 100\\,000$ の場合に次のプレイヤーが負けるポジションの数を求めなさい。
# --hints--
`nimSquare()``2586528661783` を返す必要があります。
```js
assert.strictEqual(nimSquare(), 2586528661783);
```
# --seed--
## --seed-contents--
```js
function nimSquare() {
return true;
}
nimSquare();
```
# --solutions--
```js
// solution required
```