freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-262-mountain-range.md

56 lines
1.6 KiB
Markdown
Raw Normal View History

---
id: 5900f4731000cf542c50ff85
challengeType: 5
videoUrl: ''
2020-10-01 15:54:21 +00:00
title: 问题262山脉
---
## Description
<section id="description">以下等式表示山区的连续地形给出任意点xy处的高程h <p>蚊子打算从A200,200飞到B1400,1400而不会离开0≤xy≤1600的区域。 </p><p>由于中间的山脉它首先直线上升到A&#39;具有高度f。然后在保持在相同高度f的同时它在任何障碍物周围飞行直到它到达B正上方的B&#39;点。 </p><p>首先确定fmin它是允许从A到B的这种行程的最小恒定高度同时保持在指定区域。然后找到A&#39;和B&#39;之间最短路径的长度同时以恒定高度fmin飞行。 </p><p>将该长度作为答案,四舍五入到小数点后三位。 </p><p>注意为方便起见下面以适合大多数编程语言的形式重复上面显示的高程函数h =5000-0.005 <em>x</em> x + y <em>y + x</em> y+12.5 <em>x + y</em> exp - abs0.000001 <em>x</em> x + y <em>y-0.0015</em> x + y+0.7 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler262()</code>应返回2531.205。
testString: assert.strictEqual(euler262(), 2531.205);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler262() {
// Good luck!
return true;
}
euler262();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>