* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
43 lines
1.0 KiB
Markdown
43 lines
1.0 KiB
Markdown
---
|
||
id: 5900f4841000cf542c50ff97
|
||
title: 问题280:蚂蚁和种子
|
||
challengeType: 5
|
||
videoUrl: ''
|
||
dashedName: problem-280-ant-and-seeds
|
||
---
|
||
|
||
# --description--
|
||
|
||
费力的蚂蚁在5x5的网格上随机行走。 步行从中央广场开始。 在每个步骤中,蚂蚁都会随机移动到相邻的正方形,而不会离开网格。 因此,根据蚂蚁的位置,每一步有2、3或4种可能的移动。
|
||
|
||
步行开始时,将种子放在下排的每个正方形上。 当蚂蚁不携带种子并到达包含种子的下排的正方形时,它将开始携带种子。 蚂蚁会将种子放在最终到达的上一行的第一个空方格上。
|
||
|
||
在将所有种子都放到第一行之前,预期的步骤数是多少? 将答案四舍五入到小数点后六位。
|
||
|
||
# --hints--
|
||
|
||
`euler280()`应该返回430.088247。
|
||
|
||
```js
|
||
assert.strictEqual(euler280(), 430.088247);
|
||
```
|
||
|
||
# --seed--
|
||
|
||
## --seed-contents--
|
||
|
||
```js
|
||
function euler280() {
|
||
|
||
return true;
|
||
}
|
||
|
||
euler280();
|
||
```
|
||
|
||
# --solutions--
|
||
|
||
```js
|
||
// solution required
|
||
```
|