2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4a61000cf542c50ffb8
|
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
2020-10-01 15:54:21 +00:00
|
|
|
|
title: 问题313:滑行游戏
|
2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
2020-02-17 16:40:55 +00:00
|
|
|
|
<section id="description">
|
|
|
|
|
在滑动游戏中,柜台可以水平或垂直滑入一个空白区域。 游戏的目的是将红色计数器从网格的左上角移至右下角。 该空间始终始于右下角。 例如,以下图片序列显示了如何在2 x 2网格上进行5次移动才能完成游戏。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
令S(m,n)代表完成游戏的最小移动次数。 例如,可以验证S(5.4)= 25。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
正好有5482个网格,其中S(m,n)= p2,其中p <100是质数。
|
|
|
|
|
|
|
|
|
|
S(m,n)= p2有多少个网格,其中p <106是素数?
|
|
|
|
|
</section>
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
## Instructions
|
2020-02-17 16:40:55 +00:00
|
|
|
|
<section id="instructions">
|
|
|
|
|
</section>
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
tests:
|
2020-02-17 16:40:55 +00:00
|
|
|
|
- text: <code>euler313()</code>应该返回2057774861813004。
|
|
|
|
|
testString: assert.strictEqual(euler313(), 2057774861813004);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler313() {
|
|
|
|
|
// Good luck!
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler313();
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
2020-08-13 15:24:35 +00:00
|
|
|
|
|
|
|
|
|
/section>
|