freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-459-flipping-game.r...

56 lines
2.1 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: 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>