56 lines
1.7 KiB
Markdown
56 lines
1.7 KiB
Markdown
|
---
|
|||
|
id: 5900f4f41000cf542c510007
|
|||
|
challengeType: 5
|
|||
|
title: 'Problem 392: Enmeshed unit circle'
|
|||
|
videoUrl: ''
|
|||
|
localeTitle: 问题392:陷入困境的单位圆
|
|||
|
---
|
|||
|
|
|||
|
## Description
|
|||
|
<section id="description">直线网格是正交网格,其中网格线之间的间距不必是等距的。这种网格的一个例子是对数图纸。 <p>考虑笛卡尔坐标系中的直线网格,具有以下属性:网格线平行于笛卡尔坐标系的轴。有N + 2个垂直网格线和N + 2个水平网格线。因此存在(N + 1)x(N + 1)个矩形单元。两个外部垂直网格线的方程是x = -1且x = 1.两个外部水平网格线的方程是y = -1和y如果它们与单位圆重叠,则网格单元为红色,否则为黑色。对于这个问题,我们希望您找到剩余的N个内部水平线和N个内部垂直网格线的位置,以便红色占据的区域细胞最小化。 </p><p>例如,这里是N = 10的解决方案的图片: </p><p>红色单元占N = 10的区域舍入到小数点后面的10位是3.3469640797。 </p><p>找到N = 400的位置。将红色单元占用的区域四舍五入到小数点后面的10位数作为答案。 </p></section>
|
|||
|
|
|||
|
## Instructions
|
|||
|
<section id="instructions">
|
|||
|
</section>
|
|||
|
|
|||
|
## Tests
|
|||
|
<section id='tests'>
|
|||
|
|
|||
|
```yml
|
|||
|
tests:
|
|||
|
- text: <code>euler392()</code>应返回3.1486734435。
|
|||
|
testString: 'assert.strictEqual(euler392(), 3.1486734435, "<code>euler392()</code> should return 3.1486734435.");'
|
|||
|
|
|||
|
```
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
## Challenge Seed
|
|||
|
<section id='challengeSeed'>
|
|||
|
|
|||
|
<div id='js-seed'>
|
|||
|
|
|||
|
```js
|
|||
|
function euler392() {
|
|||
|
// Good luck!
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
euler392();
|
|||
|
|
|||
|
```
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
## Solution
|
|||
|
<section id='solution'>
|
|||
|
|
|||
|
```js
|
|||
|
// solution required
|
|||
|
```
|
|||
|
</section>
|