Files
freeCodeCamp/curriculum/challenges/japanese/10-coding-interview-prep/project-euler/problem-147-rectangles-in-cross-hatched-grids.md
2022-01-20 20:30:18 +01:00

1.6 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f3ff1000cf542c50ff12 問題 147: 斜交平行格子内の長方形 5 301776 problem-147-rectangles-in-cross-hatched-grids

--description--

下図に示すとおり、3 x 2 の斜交平行格子の場合、格子内に計 37 個の異なる長方形を配置できます。

3 x 2 の斜交平行格子に配置されたさまざまな長方形

縦と横の寸法を考慮した場合、3 x 2 よりも小さい格子は 1x1, 2x1, 3x1, 1x2, 2x2 の 5 つです。 それぞれが斜交平行格子である場合、それらの小さな格子内に配置できる異なる長方形の数は次のとおりです。

\begin{array}{|c|c|} \hline 1 \times 1 & 1 \\\\ \hline 2 \times 1 & 4 \\\\ \hline 3 \times 1 & 8 \\\\ \hline 1 \times 2 & 4 \\\\ \hline 2 \times 2 & 18 \\\\ \hline \end{array}

これらを 3 x 2 の格子の 37 個に加えると、3 x 2 の格子とそれより小さい格子の中に計 72 個の異なる長方形を配置できます。

47 x 43 の格子とそれより小さい格子の中に、異なる長方形をいくつ配置できますか。

--hints--

crossHatchedRectangles()846910284 を返す必要があります。

assert.strictEqual(crossHatchedRectangles(), 846910284);

--seed--

--seed-contents--

function crossHatchedRectangles() {

  return true;
}

crossHatchedRectangles();

--solutions--

// solution required