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

1.3 KiB
Raw Blame History

id title challengeType videoUrl dashedName
5900f4731000cf542c50ff85 问题262山脉 5 problem-262-mountain-range

--description--

以下等式表示山区的连续地形给出任意点xy处的高程h

蚊子打算从A200,200飞到B1400,1400而不会离开0≤xy≤1600的区域。

由于中间的山脉它首先直线上升到A'点具有高度f。然后在保持在相同高度f的同时它在任何障碍物周围飞行直到它到达B正上方的B'点。

首先确定fmin它是允许从A到B的这种行程的最小恒定高度同时保持在指定区域。然后找到A'和B'之间最短路径的长度同时以恒定高度fmin飞行。

将该长度作为答案,四舍五入到小数点后三位。

注意为方便起见下面以适合大多数编程语言的形式重复上面显示的高程函数h =5000-0.005 x x + y y + x y+12.5 x + y exp - abs0.000001 x x + y y-0.0015 x + y+0.7

--hints--

euler262()应返回2531.205。

assert.strictEqual(euler262(), 2531.205);

--seed--

--seed-contents--

function euler262() {

  return true;
}

euler262();

--solutions--

// solution required