freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-460-an-ant-on-the-m...

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: 5900f5381000cf542c51004b
challengeType: 5
title: 'Problem 460: An ant on the move'
videoUrl: ''
localeTitle: 问题460移动中的蚂蚁
---
## Description
<section id="description">在欧几里得平面上蚂蚁从点A0,1行进到点Bd1得到整数d。 <p>在每个步骤中x0y0处的蚂蚁选择满足x1≥0且y1≥1的格点x1y1之一并以恒定速度v直接到x1y1。 v取决于y0和y1如下如果y0 = y1则v的值等于y0。如果y0≠y1则v的值等于y1-y0/lny1-lny0</p><p>左图是d = 4的可能路径之一。首先蚂蚁以速度3 - 1/ln3 - ln1从A0,1到达P11,3 ≈1.8205。然后所需的时间是sqrt5/1.8205≈1.2283。从P11,3到P23,3蚂蚁以速度3行进因此所需时间为2 /3≈0.6667。从P23,3到B4,1蚂蚁以速度1 - 3/ln1 - ln3≈1.8205所以需要的时间是sqrt5/ 1.8205 ...“抓鸟”英语词典1.2283。因此总的所需时间是1.2283 + 0.6667 + 1.2283 = 3.1233。 </p><p>正确的形象是另一条道路。总的所需时间计算为0.98026 + 1 + 0.98026 = 2.96052。可以证明这是d = 4的最快路径。 </p><p>如果蚂蚁选择最快的路径则让Fd成为所需的总时间。例如F4≈2.960516287。我们可以验证F10≈4.6668787834和F100≈9.217221972。 </p><p>找到F10000。将您的答案四舍五入到小数点后九位。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler460()</code>应该返回18.420738199。
testString: 'assert.strictEqual(euler460(), 18.420738199, "<code>euler460()</code> should return 18.420738199.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler460() {
// Good luck!
return true;
}
euler460();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>