2022-01-20 19:30:18 +00:00
|
|
|
---
|
|
|
|
id: 5900f4371000cf542c50ff49
|
|
|
|
title: '問題 202: レーザー光線'
|
2022-07-12 11:56:02 +00:00
|
|
|
challengeType: 1
|
2022-01-20 19:30:18 +00:00
|
|
|
forumTopicId: 301843
|
|
|
|
dashedName: problem-202-laserbeam
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
|
|
3 枚の鏡が、鏡面を内側に向けて正三角形を形作るように置かれています。 三角形の各頂点には、レーザー光線が通れる非常に小さな穴があります。
|
|
|
|
|
|
|
|
頂点を $A$, $B$, $C$ とします。 レーザー光線が頂点 $C$ から入り、11 回反射して同じ頂点から出るには、2 通りの経路があります。その一つは下図、もう一つはその逆です。
|
|
|
|
|
|
|
|
<img class="img-responsive center-block" alt="レーザー光線が頂点 C から入り、11 回反射して同じ頂点から出る経路の一つ" src="https://cdn.freecodecamp.org/curriculum/project-euler/laserbeam.gif" style="background-color: white; padding: 10px;" />
|
|
|
|
|
|
|
|
レーザー光線が頂点 $C$ から入り、1000001 回反射して同じ頂点から出るには、80840 通りの経路があります。
|
|
|
|
|
|
|
|
レーザー光線が頂点 $C$ から入り、12017639147 回反射して同じ頂点から出るには、何通りの経路がありますか。
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
|
|
`laserbeam()` は `1209002624` を返す必要があります。
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert.strictEqual(laserbeam(), 1209002624);
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
|
|
|
function laserbeam() {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
laserbeam();
|
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|