56 lines
2.1 KiB
Markdown
56 lines
2.1 KiB
Markdown
---
|
||
id: 5900f5371000cf542c51004a
|
||
challengeType: 5
|
||
title: 'Problem 459: Flipping game'
|
||
videoUrl: ''
|
||
localeTitle: 'Задача 459: Перевернутая игра'
|
||
---
|
||
|
||
## Description
|
||
<section id="description"> Перевернутая игра - игра с двумя игроками, играемая на квадратной доске N на N. Каждый квадрат содержит диск с одной боковой белой и одной боковой черной. Игра начинается со всех дисков, показывающих их белую сторону. <p> Поворот состоит из переворачивания всех дисков в прямоугольник со следующими свойствами: верхний правый угол прямоугольника содержит белый диск, ширина прямоугольника - идеальный квадрат (1, 4, 9, 16, ...), высота прямоугольника - треугольное число (1, 3, 6, 10, ...) </p><p> Игроки чередуют обороты. Игрок выигрывает, поворачивая сетку черным. </p><p> Пусть W (N) - количество выигрышных движений для первого игрока на плате N на N, при этом все диски белые, при условии идеальной игры. W (1) = 1, W (2) = 0, W (5) = 8 и W (102) = 31395. </p><p> Для N = 5 первые восемь первых побед первого игрока: </p><p> Найти W (106). </p></section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: ''
|
||
testString: 'assert.strictEqual(euler459(), 3996390106631, "<code>euler459()</code> should return 3996390106631.");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function euler459() {
|
||
// Good luck!
|
||
return true;
|
||
}
|
||
|
||
euler459();
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|