freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-299-three-similar-t...

71 lines
1.6 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: 5900f4971000cf542c50ffaa
challengeType: 5
videoUrl: ''
localeTitle: 问题299三个相似的三角形
---
## Description
<section id="description">
选择了四个具有整数坐标的点Aa0Bb0C0c和D0d
其中0 <a <b0 <c <d
AC线上选择点P(也具有整数坐标),以便三个三角形ABPCDPBDP都相似。
仅当a = c时容易证明三个三角形可以相似。
因此,给定a = c我们正在寻找三元组abd使得AC上至少存在一个点P具有整数坐标从而使三个三角形ABPCDP和BDP都相似。
例如,如果(abd234),则可以容易地验证点P11)满足上述条件。
请注意,三点式(2,3,4)和(2,4,3)被认为是截然不同的,尽管点P1,1)对于两者而言是共同的。
如果b + d <100,则存在92个不同的三元组(abd),从而存在点P.
如果b + d <100000,则存在320471个不同的三元组(abd),从而存在点P.
如果b + d <100000000,那么有几个不同的三元组(abd)使得点P存在?
</section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler299()</code>应该返回549936643。
testString: assert.strictEqual(euler299(), 549936643);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler299() {
// Good luck!
return true;
}
euler299();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>