Files
freeCodeCamp/curriculum/challenges/japanese/10-coding-interview-prep/project-euler/problem-154-exploring-pascals-pyramid.md
2022-01-20 20:30:18 +01:00

1.5 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f4071000cf542c50ff19 問題 154: パスカルの三角錐を探索する 5 301785 problem-154-exploring-pascals-pyramid

--description--

それぞれの球がすぐ下の層の 3 つの球の上に乗っているような構造を繰り返し、三角錐を作ります。

球が 4 段に積まれた三角錐

次に、頂点から各位置への経路の数を計算します。経路は頂点から始まり、現在の位置のすぐ下にある 3 つの球のいずれかに下がっていきます。 したがって、ある位置に到達する経路の数は、その位置の上にある数字の和です (位置によって異なりますが、1 つの位置の上に最大 3 つの数字があります)。

その結果として作られるのがパスカルの三角錐であり、各段 n にある数字は三項展開 {(x + y + z)}^n の係数です。

{(x + y + z)}^{200000} の展開における係数のうち、{10}^{12} の倍数はいくつありますか。

--hints--

pascalsPyramid()479742450 を返す必要があります。

assert.strictEqual(pascalsPyramid(), 479742450);

--seed--

--seed-contents--

function pascalsPyramid() {

  return true;
}

pascalsPyramid();

--solutions--

// solution required