chore(i18n,learn): processed translations (#44866)

This commit is contained in:
camperbot
2022-01-22 20:38:20 +05:30
committed by GitHub
parent d039479e66
commit 43a2a0a395
324 changed files with 2907 additions and 2916 deletions

View File

@ -27,6 +27,7 @@ Reescribe el código para que el arreglo global `bookList` no sea cambiado dentr
`bookList` no debe cambiar y aún ser igual a `["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]`.
```js
add(bookList, "Test");
assert(
JSON.stringify(bookList) ===
JSON.stringify([
@ -38,11 +39,11 @@ assert(
);
```
`newBookList` debe ser igual a `["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]`.
`add(bookList, "A Brief History of Time")` debe devolver `["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]`.
```js
assert(
JSON.stringify(newBookList) ===
JSON.stringify(add(bookList, "A Brief History of Time")) ===
JSON.stringify([
'The Hound of the Baskervilles',
'On The Electrodynamics of Moving Bodies',
@ -53,11 +54,11 @@ assert(
);
```
`newerBookList` debe ser igual a `["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]`.
`remove(bookList, "On The Electrodynamics of Moving Bodies")` debe devolver `["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]`.
```js
assert(
JSON.stringify(newerBookList) ===
JSON.stringify(remove(bookList, 'On The Electrodynamics of Moving Bodies')) ===
JSON.stringify([
'The Hound of the Baskervilles',
'Philosophiæ Naturalis Principia Mathematica',
@ -66,11 +67,11 @@ assert(
);
```
`newestBookList` debe ser igual a `["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]`.
`remove(add(bookList, "A Brief History of Time"), "On The Electrodynamics of Moving Bodies");` debe ser igual a `["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]`.
```js
assert(
JSON.stringify(newestBookList) ===
JSON.stringify(remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies')) ===
JSON.stringify([
'The Hound of the Baskervilles',
'Philosophiæ Naturalis Principia Mathematica',
@ -108,12 +109,6 @@ function remove(bookName) {
// Change code above this line
}
}
const newBookList = add(bookList, 'A Brief History of Time');
const newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies');
const newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies');
console.log(bookList);
```
# --solutions--
@ -134,8 +129,4 @@ function remove(bookList, bookName) {
}
return bookListCopy;
}
const newBookList = add(bookList, 'A Brief History of Time');
const newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies');
const newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies');
```

View File

@ -10,7 +10,7 @@ dashedName: call-out-optional-actions-with-btn-info
Bootstrap viene con varios colores predefinidos para los botones. La clase `btn-info` se utiliza para llamar la atención sobre las acciones opcionales que el usuario puede realizar.
Crea un nuevo botón de Bootstrap debajo de tu botón `Like` con el texto `Info` y añádele las clases de Bootstrap `btn-info` y `btn-block`.
Crea un nuevo botón de Bootstrap a nivel de bloque debajo de tu botón de `Like` con el texto `Info`, y agrégale la clase de Boostrap `btn-info`.
Ten en cuenta que estos botones todavía necesitan las clases `btn` y `btn-block`.

View File

@ -31,7 +31,7 @@ freeCodeCamp の HTML コーディングチャレンジへようこそ。 この
開始タグと終了タグの違いは、終了タグは最初の括弧の後にスラッシュがあることです。
各チャレンジにはテストがあり、「Run tests」ボタンをクリックしていつでも実行できます。 全てのテストにパスすると、解答を提出して次のチャレンジに進むことができます。
各チャレンジにはテストがあり、「テスト実行」ボタンをクリックしていつでも実行できます。 全てのテストにパスすると、解答を提出して次のチャレンジに進むことができます。
# --instructions--

View File

@ -12,7 +12,7 @@ dashedName: build-a-personal-portfolio-webpage
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を満たし、すべてのテストがパスするようにしてください。 あなた独自のスタイルを与えてください。
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 私達は、このプロジェクト推奨技術スタックを使用している場合の問題報告は全て受け入れ、修正するよう努めます。 ハッピーコーディング!
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 このプロジェクト推奨される一連のテクロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 ハッピーコーディング!
**ユーザーストーリー #1:** 私のポートフォリオには、`welcome-section` の id を持つウェルカムセクションがあります。

View File

@ -12,7 +12,7 @@ dashedName: build-a-product-landing-page
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を満たし、すべてのテストがパスするようにしてください。 あなた独自のスタイルを与えてください。
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 私達は、このプロジェクト推奨技術スタックを使用している場合の問題報告は全て受け入れ、修正するよう努めます。 ハッピーコーディング!
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 このプロジェクト推奨される一連のテクロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 ハッピーコーディング!
**ユーザーストーリー #1:** 私のプロダクトランディングページには `id="header"` を持つ `header` 要素があります。

View File

@ -12,7 +12,7 @@ dashedName: build-a-survey-form
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を満たし、すべてのテストがパスするようにしてください。 あなた独自のスタイルを与えてください。
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 私達は、このプロジェクト推奨技術スタックを使用している場合の問題報告は全て受け入れ、修正するよう努めます。 ハッピーコーディング!
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 このプロジェクト推奨される一連のテクロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 ハッピーコーディング!
**ユーザーストーリー #1:** `id="title"` を持つ H1 サイズテキストのタイトルがあります。

View File

@ -12,7 +12,7 @@ dashedName: build-a-technical-documentation-page
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を満たし、すべてのテストがパスするようにしてください。 あなた独自のスタイルを与えてください。
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 私達は、このプロジェクト推奨技術スタックを使用している場合の問題報告は全て受け入れ、修正するよう努めます。 ハッピーコーディング!
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 このプロジェクト推奨される一連のテクロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 ハッピーコーディング!
**ユーザーストーリー #1:** `id="main-doc"` を持ち、ページのメインコンテンツ (テクニカルドキュメント) を含む `main` 要素があります。
@ -38,7 +38,7 @@ dashedName: build-a-technical-documentation-page
**ユーザーストーリー #12:** `nav-link` クラスの各要素には、各 `section` 内の `header` テキストに対応するテキストが含まれていなければなりません (例えば、もし "Hello world" セクション / ヘッダーがあるならば、ナビゲーションバーには "Hello world" テキストを含む要素が必要です) 。
**ユーザーストーリー #13:** ナビゲーションバーの要素をクリックしたとき、ページは `main-doc` 要素の対応するセクションに移動しなければなりません (例えば、"Hello world" テキストを含む `nav-link` 要素をクリックしたなら、その id を持ち対応する `header` を含む `section` 要素に移動しなければなりません)。
**ユーザーストーリー #13:** ナビゲーションバーの要素をクリックしたとき、ページは `main-doc` 要素の対応するセクションに移動しなければなりません (例えば、"Hello world" テキストを含む `nav-link` 要素をクリックしたなら、その id を持ち対応する `header` を含む `section` 要素に移動しなければなりません)。
**ユーザーストーリー #14:** 通常サイズのデバイス上 (ラップトップ、デスクトップ) では、`id="navbar"` を持つ要素は画面の左側に表示され、常にユーザーから見える状態にしなければなりません。

View File

@ -12,13 +12,13 @@ dashedName: build-a-tribute-page
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を満たし、すべてのテストがパスするようにしてください。 あなた独自のスタイルを与えてください。
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 私達は、このプロジェクト推奨技術スタックを使用している場合の問題報告は全て受け入れ、修正するよう努めます。 ハッピーコーディング!
このプロジェクトを完了するために、HTML、JavaScript、CSS を使用することができます。 これまでのレッスンでカバーされた純粋な CSS の練習をするため、純粋な CSS の使用を推奨します。 Bootstrap や SASS を使用しても構いません。 このプロジェクトで追加のテクノロジー (jQuery、React、Angular、Vue など) を使用することは推奨されません。使用する場合は自己責任で使用してください。 React のようなさまざまな技術スタックで作業する機会は他のプロジェクトで得られます。 このプロジェクト推奨される一連のテクロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 ハッピーコーディング!
**ユーザーストーリー #1:** 私のトリビュートページには `id="main"` を持つ要素があり、その中に他のすべての要素が含まれます。
**ユーザーストーリー #2:** `id="title"` を持つ要素があり、これにはトリビュートページで取り上げる対象者 (例: "Dr. Norman Borlaug) を説明する文字列 (すなわちテキスト) が記載されています。
**ユーザーストーリー #3:** `id="img-div"` が付随する `figure` または `div` 要素のどちらか一方が表示される必要があります。
**ユーザーストーリー #3:** `id="img-div"` を持つ、`figure` または `div` 要素のどちらかが表示される必要があります。
**ユーザーストーリー #4:** `img-div` 要素内に、`id="image"` を持つ `img` 要素があります。
@ -28,7 +28,7 @@ dashedName: build-a-tribute-page
**ユーザーストーリー #7:** `id="tribute-link"` を持つ `a` 要素があり、これはトリビュートページの対象者に関する追加情報を含む外部サイトへのリンクです。 ヒント: リンクを新しいタブで開くためには、要素に `target` 属性を与え、その値に `_blank` を設定しなければなりません (つまり `target="_blank"` となります)。
**ユーザーストーリー #8:** `img` 要素は、オリジナルのサイズを超えることなく親要素の幅に応じてレスポンシブにサイズが変更される必要があります。
**ユーザーストーリー #8:** `img` 要素は、オリジナルのサイズを超えることなく親要素の幅に応じてレスポンシブにサイズが変更される必要があります。
**ユーザーストーリー #9:** `img` 要素は、その親要素内で中央に配置される必要があります。

View File

@ -12,7 +12,7 @@ dashedName: build-a-25--5-clock
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を達成して、すべてのテストに合格してください。 アプリにはあなた独自のスタイルを設定してください。
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨している一連のテクノロジーを使用して生じた問題についてはすべて、報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨される一連のテクノロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
**ユーザーストーリー 1:** 文字列 ("Break Length" など) が含まれている `id="break-label"` を持つ要素を表示できます。

View File

@ -12,7 +12,7 @@ dashedName: build-a-drum-machine
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を達成して、すべてのテストに合格してください。 アプリにはあなた独自のスタイルを設定してください。
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨している一連のテクノロジーを使用して生じた問題についてはすべて、報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨される一連のテクノロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
**ユーザーストーリー 1:** 対応する `id="drum-machine"` を持ち、他のすべての要素を収める、外側のコンテナを表示できます。

View File

@ -12,7 +12,7 @@ dashedName: build-a-javascript-calculator
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を達成して、すべてのテストに合格してください。 アプリにはあなた独自のスタイルを設定してください。
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨している一連のテクノロジーを使用して生じた問題についてはすべて、報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨される一連のテクノロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
**ユーザーストーリー 1:** `=` (等号) を含み、対応する `id="equals"` を持つ、クリック可能な要素が電卓にあります。

View File

@ -12,7 +12,7 @@ dashedName: build-a-markdown-previewer
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を達成して、すべてのテストに合格してください。 アプリにはあなた独自のスタイルを設定してください。
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨している一連のテクノロジーを使用して生じた問題についてはすべて、報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨される一連のテクノロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
**ユーザーストーリー 1:** 対応する `id="editor"` を持つ `textarea` 要素を表示できます。

View File

@ -12,7 +12,7 @@ dashedName: build-a-random-quote-machine
以下の[ユーザーストーリー](https://en.wikipedia.org/wiki/User_story)を達成して、すべてのテストに合格してください。 アプリにはあなた独自のスタイルを設定してください。
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨している一連のテクノロジーを使用して生じた問題についてはすべて、報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
このプロジェクトを完了するために、HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、および jQuery を自在に組み合わせて利用することができます。 このセクションはフロントエンドフレームワークの学習を目的としていますので、React などのフロントエンドフレームワークを使用してください。 上記以外の他のテクノロジーは推奨されません。使用する場合は自己責任で行ってください。 Angular や Vue などの他のフロントエンドフレームワークのサポートを検討していますが、現時点ではサポートされていません。 このプロジェクトで推奨される一連のテクノロジーを使用している場合の不具合報告については、freeCodeCamp にて報告を受け入れ、修正するよう努めます。 コーディングの成功を祈ります!
**ユーザーストーリー 1:** 対応する `id="quote-box"` を持つラッパー要素を表示できます。

View File

@ -1,6 +1,6 @@
---
id: bd7178d8c242eddfaeb5bd13
title: Visualize Data with a Scatterplot Graph
title: 散布図でデータを可視化する
challengeType: 3
forumTopicId: 301467
dashedName: visualize-data-with-a-scatterplot-graph

View File

@ -81,7 +81,7 @@ assert(adjMatUndirected[0][2] === 1 && adjMatUndirected[2][0] === 1);
assert(adjMatUndirected[2][4] === 1 && adjMatUndirected[4][2] === 1);
```
There should be an edge between the fourth and fifth node.
4 番目と 5 番目のノードの間にはエッジが必要です。
```js
assert(adjMatUndirected[3][4] === 1 && adjMatUndirected[4][3] === 1);

View File

@ -28,7 +28,7 @@ dashedName: breadth-first-search
隣接行列グラフ (二次元配列) とノードラベルの根 (開始ノード) をパラメータとして取る関数、`bfs()` を記述してください。 ノードラベルは単に `0` から `n - 1` の間の整数値です (`n` はグラフ内のノードの総数)。
Your function will output a JavaScript object key-value pairs with the node and its distance from the root. そのノードに到達できなかった場合、そのノードは `Infinity` の距離を持つ必要があります。
この関数は、JavaScript オブジェクトのキーと値のペア (ノードと、根からそのノードまでの距離) を出力します。 そのノードに到達できなかった場合、そのノードは `Infinity` の距離を持つ必要があります。
# --hints--

View File

@ -8,7 +8,7 @@ dashedName: create-an-es6-javascript-map
# --description--
JavaScript の新バージョンでは、前回のチャレンジで手書きした機能の多くを提供する、組み込みの Map ブジェクトが提供されています。 This Map object, although similar to regular JavaScript objects, provides some useful functionality that normal objects lack. For example, an ES6 Map tracks the insertion order of items that are added to it. より網羅的なメソッドの概要を次に示します。`.has(key)` はキーの有無に基づいて true または false を返します。`.get(key)` はキーに関連付けられた値を返します。`.set(key, value)` は新しいキーと値のペアを設定します。`.delete(key)` はキーと値のペアを削除します。`.clear()` はすべてのキーと値のペアを削除します。`.entries()` は挿入順にすべてのキーの配列を返します。`.values()` は挿入順にすべての値の配列を返します。
JavaScript の新バージョンでは、前回のチャレンジで手書きした機能の多くを提供する、組み込みの Map ブジェクトが提供されています。 この Map オブジェクトは通常の JavaScript オブジェクトと似ていますが、通常のオブジェクトにはない便利な機能を提供します。 例えば ES6 Map は、それに追加された要素の挿入順序を追跡します。 より網羅的なメソッドの概要を次に示します。`.has(key)` はキーの有無に基づいて true または false を返します。`.get(key)` はキーに関連付けられた値を返します。`.set(key, value)` は新しいキーと値のペアを設定します。`.delete(key)` はキーと値のペアを削除します。`.clear()` はすべてのキーと値のペアを削除します。`.entries()` は挿入順にすべてのキーの配列を返します。`.values()` は挿入順にすべての値の配列を返します。
# --instructions--

View File

@ -25,7 +25,7 @@ assert(
);
```
The union of a Set containing values ["a", "b", "c"] and a Set containing values ["c", "d"] should return a new Set containing values ["a", "b", "c", "d"].
値 ["a", "b", "c"] を含む Set と値 ["c", "d"] を含む Set の和集合は、値 ["a", "b", "c", "d"] を含む新しい Set を返す必要があります。
```js
assert(

View File

@ -8,7 +8,7 @@ dashedName: work-with-nodes-in-a-linked-list
# --description--
コンピュータサイエンスの世界でよく目にするもう一つのデータ構造は、<dfn>リンクリスト</dfn>です。 リンクリストは「ノード」と呼ばれるデータ要素の線形コレクションであり、それぞれが次の要素を指しています。 Each <dfn>node</dfn> in a linked list contains two key pieces of information: the `element` itself, and a reference to the next `node`.
コンピュータサイエンスの世界でよく目にするもう一つのデータ構造は、<dfn>リンクリスト</dfn>です。 リンクリストは「ノード」と呼ばれるデータ要素の線形コレクションであり、それぞれが次の要素を指しています。 リンクリスト内の各<dfn>ノード</dfn>には重要な情報が 2 つ含まれています。それは、`element` そのものと、次の `node` への参照です。
あなたがコンガラインの中にいるのを想像してみてください。 あなたはラインの中で自分のすぐ前の人に手を置き、後ろの人はあなたに手を置いています。 前の人はあなたの正面にいますが、その人が視界を遮るため、もっと前にいる人たちがあなたからは見えません。 ノードはコンガラインの人と同じようなものです。自分のことを知っていて、目の前にいる人だけを見ています。その人の前や自分の後ろにいる、他の人たちの存在には気付きません。

View File

@ -1,6 +1,6 @@
---
id: 5900f3fc1000cf542c50ff0e
title: '三角形のトリチェリ点を調べ上げる'
title: '問題 143: 三角形のトリチェリ点を調べ上げる'
challengeType: 5
forumTopicId: 301772
dashedName: problem-143-investigating-the-torricelli-point-of-a-triangle

View File

@ -1,6 +1,6 @@
---
id: 5900f4051000cf542c50ff18
title: 'ガウス整数を調べ上げる'
title: '問題 153: ガウス整数を調べ上げる'
challengeType: 5
forumTopicId: 301784
dashedName: problem-153-investigating-gaussian-integers

View File

@ -1,6 +1,6 @@
---
id: 5900f40f1000cf542c50ff22
title: '斜交平行三角形'
title: '問題 163: 斜交平行三角形'
challengeType: 5
forumTopicId: 301797
dashedName: problem-163-cross-hatched-triangles

View File

@ -1,6 +1,6 @@
---
id: 5900f4291000cf542c50ff3b
title: 'Problem 188: 数の超累乗'
title: '問題 188: 数の超累乗'
challengeType: 5
forumTopicId: 301824
dashedName: problem-188-the-hyperexponentiation-of-a-number

View File

@ -1,6 +1,6 @@
---
id: 5900f4311000cf542c50ff43
title: '60 度の角を 1 つ持つ三角形の内接円'
title: '問題 195: 60 度の角を 1 つ持つ三角形の内接円'
challengeType: 5
forumTopicId: 301833
dashedName: problem-195-inscribed-circles-of-triangles-with-one-angle-of-60-degrees

View File

@ -1,6 +1,6 @@
---
id: 5900f4571000cf542c50ff69
title: 'Problem 234: 半整除可能な数'
title: '問題 234: 半整除可能な数'
challengeType: 5
forumTopicId: 301878
dashedName: problem-234-semidivisible-numbers

View File

@ -1,6 +1,6 @@
---
id: 5900f46c1000cf542c50ff7e
title: 'Problem 256: Tatami-Free Rooms'
title: '問題 256: 畳を敷けない部屋'
challengeType: 5
forumTopicId: 301904
dashedName: problem-256-tatami-free-rooms
@ -8,29 +8,29 @@ dashedName: problem-256-tatami-free-rooms
# --description--
Tatami are rectangular mats, used to completely cover the floor of a room, without overlap.
畳のような長方形のマットを、部屋の床の上に互いに重ねることなく敷き詰める場合を考えます。
Assuming that the only type of available tatami has dimensions 1×2, there are obviously some limitations for the shape and size of the rooms that can be covered.
サイズが 1 × 2 の畳しかないと仮定すると、当然、その畳で敷き詰めることのできる部屋の形やサイズには制限があります。
For this problem, we consider only rectangular rooms with integer dimensions $a$, $b$ and even size $s = a \times b$. We use the term 'size' to denote the floor surface area of the room, and — without loss of generality — we add the condition $a ≤ b$.
この問題では、整数寸法 $a$ $b$、および偶数サイズ $s = a \times b$ を持つ長方形の部屋のみを考えます。 ここで、「サイズ」は部屋の床面積を表します。また、一般性を失うことなく、$a ≤ b$ という条件を加えます。
There is one rule to follow when laying out tatami: there must be no points where corners of four different mats meet. For example, consider the two arrangements below for a 4×4 room:
畳を敷くときは 1 つのルールがあります。4 枚の畳の角が 1 ヵ所に集まってはいけないのです。 例えば、4 × 4 の部屋を次の 2 通りで敷くことを考えます。
<img class="img-responsive center-block" alt="two arragements of mats in 4x4 room" src="https://cdn.freecodecamp.org/curriculum/project-euler/tatami-free-rooms.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="4x4 の部屋に畳を敷く場合の 2 通りの配置" src="https://cdn.freecodecamp.org/curriculum/project-euler/tatami-free-rooms.gif" style="background-color: white; padding: 10px;" />
The arrangement on the left is acceptable, whereas the one on the right is not: a red "<strong><span style="color: red;">X</span></strong>" in the middle, marks the point where four tatami meet.
左側の配置は問題ありませんが、右側の配置はルールに反しています。中央の赤い印 "<strong><span style="color: red;">X</span></strong>" は、4 枚の畳の角が集まっている個所を示しています。
Because of this rule, certain even-sized rooms cannot be covered with tatami: we call them tatami-free rooms. Further, we define $T(s)$ as the number of tatami-free rooms of size $s$.
このルールにより、ある偶数サイズの部屋は畳を敷き詰めることができません。そのような部屋を「畳を敷けない部屋」と呼ぶことにします。 さらに、サイズが $s$ である「畳を敷けない部屋」の数を $T(s)$ とします。
The smallest tatami-free room has size $s = 70$ and dimensions 7×10. All the other rooms of size $s = 70$ can be covered with tatami; they are: 1×70, 2×35 and 5×14. Hence, $T(70) = 1$.
最小の「畳を敷けない部屋」はサイズが $s = 70$、寸法が 710 です。 サイズ $s = 70$ である他のすべての部屋 (1×70, 2×35, 5×14) には畳を敷き詰めることができます。 したがって、$T(70) = 1$ です。
Similarly, we can verify that $T(1320) = 5$ because there are exactly 5 tatami-free rooms of size $s = 1320$: 20×66, 22×60, 24×55, 30×44 and 33×40. In fact, $s = 1320$ is the smallest room-size $s$ for which $T(s) = 5$.
同様に、サイズが $s = 1320$ である「畳を敷けない部屋」はちょうど 5 つあるので (20×66, 22×60, 24×55, 30×44, 33x40)、$T(1320) = 5$ であることを確認できます。 実は $s = 1320$ は、$T(s) = 5$ である最小の部屋のサイズ $s$ です。
Find the smallest room-size $s$ for which $T(s) = 200$.
$T(s) = 200$ である最小の部屋のサイズ $s$ を求めなさい。
# --hints--
`tatamiFreeRooms()` should return `85765680`.
`tatamiFreeRooms()` `85765680` を返す必要があります。
```js
assert.strictEqual(tatamiFreeRooms(), 85765680);

View File

@ -1,6 +1,6 @@
---
id: 5900f46e1000cf542c50ff80
title: 'Problem 257: Angular Bisectors'
title: '問題 257: 角の二等分線'
challengeType: 5
forumTopicId: 301905
dashedName: problem-257-angular-bisectors
@ -8,19 +8,19 @@ dashedName: problem-257-angular-bisectors
# --description--
Given is an integer sided triangle $ABC$ with sides $a ≤ b ≤ c$. ($AB = c$, $BC = a$ and $AC = b$).
整数の辺長を持つ三角形 $ABC$ が与えられ、辺は $a ≤ b ≤ c$ です ($AB = c$, $BC = a$, $AC = b$)
The angular bisectors of the triangle intersect the sides at points $E$, $F$ and $G$ (see picture below).
三角形の角の二等分線は、点 $E$, $F$, $G$ で辺と交わります (下図参照)。
<img class="img-responsive center-block" alt="triangle ABC, with angular bisectors intersecting sides at the points E, F and G" src="https://cdn.freecodecamp.org/curriculum/project-euler/angular-bisectors.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="三角形 ABC の角の二等分線が点 E, F, G で辺と交わる" src="https://cdn.freecodecamp.org/curriculum/project-euler/angular-bisectors.gif" style="background-color: white; padding: 10px;" />
The segments $EF$, $EG$ and $FG$ partition the triangle $ABC$ into four smaller triangles: $AEG$, $BFE$, $CGF$ and $EFG$. It can be proven that for each of these four triangles the ratio $\frac{\text{area}(ABC)}{\text{area}(\text{subtriangle})}$ is rational. However, there exist triangles for which some or all of these ratios are integral.
線分 $EF$, $EG$, $FG$ は、$ABC$ を 4 つの小さな三角形 $AEG$, $BFE$, $CGF$, $EFG$ に分割します。 この 4 つの三角形のそれぞれについて、比率 $\frac{\text{面積}(ABC)}{\text{面積}(\text{部分三角形})}$ が有理数であることを証明できます。 しかし、これらの比率の一部またはすべてが整数である三角形が存在します。
How many triangles $ABC$ with perimeter $≤ 100\\,000\\,000$ exist so that the ratio $\frac{\text{area}(ABC)}{\text{area}(AEG)}$ is integral?
周長が $100\\,000\\,000$ 以下で、比率 $\frac{\text{面積}(ABC)}{\text{面積}(AEG)}$ が整数である三角形 $ABC$ はいくつ存在しますか。
# --hints--
`angularBisectors()` should return `139012411`.
`angularBisectors()` `139012411` を返す必要があります。
```js
assert.strictEqual(angularBisectors(), 139012411);

View File

@ -1,6 +1,6 @@
---
id: 5900f46e1000cf542c50ff81
title: 'Problem 258: A lagged Fibonacci sequence'
title: '問題 258: ラグ付きフィボナッチ数列'
challengeType: 5
forumTopicId: 301906
dashedName: problem-258-a-lagged-fibonacci-sequence
@ -8,16 +8,16 @@ dashedName: problem-258-a-lagged-fibonacci-sequence
# --description--
A sequence is defined as:
数列を次のように定義します。
- $g_k = 1$, for $0 ≤ k ≤ 1999$
- $g_k = g_{k - 2000} + g_{k - 1999}$, for $k ≥ 2000$.
- $0 ≤ k ≤ 1999$ のとき、$g_k = 1$
- $k ≥ 2000$ のとき、$g_k = g_{k - 2000} + g_{k - 1999}$
Find $g_k$ mod 20092010 for $k = {10}^{18}$.
$k = {10}^{18} $ のとき、$g_k$ mod 20092010 を求めなさい。
# --hints--
`laggedFibonacciSequence()` should return `12747994`.
`laggedFibonacciSequence()` `12747994` を返す必要があります。
```js
assert.strictEqual(laggedFibonacciSequence(), 12747994);

View File

@ -1,6 +1,6 @@
---
id: 5900f4701000cf542c50ff82
title: 'Problem 259: Reachable Numbers'
title: 'Problem 259: 到達可能な数'
challengeType: 5
forumTopicId: 301907
dashedName: problem-259-reachable-numbers
@ -8,22 +8,22 @@ dashedName: problem-259-reachable-numbers
# --description--
A positive integer will be called reachable if it can result from an arithmetic expression obeying the following rules:
次の規則に沿った算術式によって得られる正の整数を、「到達可能な数」と呼ぶことにします。
- Uses the digits 1 through 9, in that order and exactly once each.
- Any successive digits can be concatenated (for example, using the digits 2, 3 and 4 we obtain the number 234).
- Only the four usual binary arithmetic operations (addition, subtraction, multiplication and division) are allowed.
- Each operation can be used any number of times, or not at all.
- Unary minus is not allowed.
- Any number of (possibly nested) parentheses may be used to define the order of operations.
- 1 から 9 の数字を、この順番でちょうど 1 回ずつ使用する。
- 任意の連続した数字を連結できる (例: 2, 3, 4 を使って 234 を得る)。
- 一般的な 2 項の四則演算 (加算、減算、乗算、除算) のみが許される。
- 各演算は何回でも使用でき、全く使用しなくても良い。
- 単項マイナスは使用できない。
- 演算の順序を指定するために括弧を何個でも使用できる (入れ子も可)。
For example, 42 is reachable, since $\frac{1}{23} \times ((4 \times 5) - 6) \times (78 - 9) = 42$.
例えば、$\frac{1}{23} \times ((4 \times 5) - 6) \times (78 - 9) = 42$ なので、42 は到達可能な数です。
What is the sum of all positive reachable integers?
到達可能な正の整数の総和を求めなさい。
# --hints--
`reachableNumbers()` should return `20101196798`.
`reachableNumbers()` `20101196798` を返す必要があります。
```js
assert.strictEqual(reachableNumbers(), 20101196798);

View File

@ -1,6 +1,6 @@
---
id: 5900f4701000cf542c50ff83
title: 'Problem 260: Stone Game'
title: '問題 260: 石取りゲーム'
challengeType: 5
forumTopicId: 301909
dashedName: problem-260-stone-game
@ -8,33 +8,33 @@ dashedName: problem-260-stone-game
# --description--
A game is played with three piles of stones and two players.
石を積み上げた 3 つの山と 2 人のプレイヤーでゲームをします。
On each player's turn, the player removes one or more stones from the piles. However, if the player takes stones from more than one pile, the same number of stones must be removed from each of the selected piles.
各プレイヤーは自分のターンで、石の山から 1 つ以上の石を取ります。 ただし、複数の山から石を取る場合は、選んだ山のそれぞれから同じ数の石を取らなければなりません。
In other words, the player chooses some $N > 0$ and removes:
つまり、プレイヤーは次のいずれかのパターンで個数 $N > 0$ を選び、山から取ります。
- $N$ stones from any single pile; or
- $N$ stones from each of any two piles ($2N$ total); or
- $N$ stones from each of the three piles ($3N$ total).
- 1 つの山から $N$ 個の石を取る。
- 2 つの山から $N$ 個ずつ石を取る (計: $2N$ 個)。
- 3 つの山から $N$ 個ずつ石を取る (計: $3N$ 個)。
The player taking the last stone(s) wins the game.
最後の石を取ったプレイヤーの勝ちです。
A winning configuration is one where the first player can force a win.
勝利構成とは、先手が必ず勝てる構成です。
For example, (0,0,13), (0,11,11) and (5,5,5) are winning configurations because the first player can immediately remove all stones.
例えば、(0,0,13), (0,11,11), (5,5,5) は、先手が即座にすべての石を取れるので、勝利構成です。
A losing configuration is one where the second player can force a win, no matter what the first player does.
敗北構成とは、先手が何をしようと 後手が必ず勝てる構成です。
For example, (0,1,2) and (1,3,3) are losing configurations: any legal move leaves a winning configuration for the second player.
例えば、(0,1,2) (1,3,3) は敗北構成です。ルールに従う限り、何をしても 後手の勝利構成になります。
Consider all losing configurations ($x_i$,$y_i$,$z_i$) where $x_i ≤ y_i ≤ z_i ≤ 100$. We can verify that $\sum (x_i + y_i + z_i) = 173\\,895$ for these.
$x_i ≤ y_i ≤ z_i ≤ 100$ として、すべての敗北構成 ($x_i$,$y_i$,$z_i$) について考えます。 それらの構成について $\sum (x_i + y_i + z_i) = 173\\,895$ であることを確認できます。
Find $\sum (x_i + y_i + z_i)$ where ($x_i$,$y_i$,$z_i$) ranges over the losing configurations with $x_i y_i z_i ≤ 1000$.
$x_i y_i z_i ≤ 1000$ として、($x_i$,$y_i$,$z_i$) が敗北構成の全範囲を表すとき、$\sum (x_i + y_i + z_i)$ を求めなさい。
# --hints--
`stoneGame()` should return `167542057`.
`stoneGame()` `167542057` を返す必要があります。
```js
assert.strictEqual(stoneGame(), 167542057);

View File

@ -1,6 +1,6 @@
---
id: 5900f4711000cf542c50ff84
title: 'Problem 261: Pivotal Square Sums'
title: '問題 261: 平方ピボットの和'
challengeType: 5
forumTopicId: 301910
dashedName: problem-261-pivotal-square-sums
@ -8,19 +8,19 @@ dashedName: problem-261-pivotal-square-sums
# --description--
Let us call a positive integer $k$ a square-pivot, if there is a pair of integers $m > 0$ and $n ≥ k$, such that the sum of the ($m + 1$) consecutive squares up to $k$ equals the sum of the $m$ consecutive squares from ($n + 1$) on:
正の整数 $k$ まで連続する ($m + 1$) 個の平方数の和が、($n + 1$) から連続する $m$ 個の平方数の和に等しくなるような、整数 $m > 0$ と 整数 $n ≥ k$ の対がある場合、すなわち次の式が成り立つ場合、$k$ を「平方ピボット」と呼ぶことにします。
$${(k - m)}^2 + \ldots + k^2 = {(n + 1)}^2 + \ldots + {(n + m)}^2$$
Some small square-pivots are
小さい平方ピボットをいくつか下に示します。
$$\begin{align} & \mathbf{4}: 3^2 + \mathbf{4}^2 = 5^2 \\\\ & \mathbf{21}: {20}^2 + \mathbf{21}^2 = {29}^2 \\\\ & \mathbf{24}: {21}^2 + {22}^2 + {23}^2 + \mathbf{24}^2 = {25}^2 + {26}^2 + {27}^2 \\\\ & \mathbf{110}: {108}^2 + {109}^2 + \mathbf{110}^2 = {133}^2 + {134}^2 \\\\ \end{align}$$
Find the sum of all distinct square-pivots $≤ {10}^{10}$.
${10}^{10}$ 以下の相異なる平方ピボットの総和を求めなさい。
# --hints--
`pivotalSquareSums()` should return `238890850232021`.
`pivotalSquareSums()` `238890850232021` を返す必要があります。
```js
assert.strictEqual(pivotalSquareSums(), 238890850232021);

View File

@ -1,6 +1,6 @@
---
id: 5900f4731000cf542c50ff85
title: 'Problem 262: Mountain Range'
title: '問題 262: 山脈'
challengeType: 5
forumTopicId: 301911
dashedName: problem-262-mountain-range
@ -8,23 +8,23 @@ dashedName: problem-262-mountain-range
# --description--
The following equation represents the continuous topography of a mountainous region, giving the elevation $h$ at any point ($x$,$y$):
下の式は山岳地帯の連続した地形図を表し、任意の地点 ($x$,$y$) の標高 $h$ を示しています。
$$h = \left(5000 - \frac{x^2 + y^2 + xy}{200} + \frac{25(x + y)}{2}\right) \times e^{-\left|\frac{x^2 + y^2}{1\\,000\\,000} - \frac{3(x + y)}{2000} + \frac{7}{10}\right|}$$
A mosquito intends to fly from A(200,200) to B(1400,1400), without leaving the area given by $0 ≤ x$, $y ≤ 1600$.
1 匹の蚊が、$0 ≤ x$, $y ≤ 1600$ で表される領域を離れることなく、A(200,200) から B(1400,1400) まで飛んで行こうとしています。
Because of the intervening mountains, it first rises straight up to a point A', having elevation $f$. Then, while remaining at the same elevation $f$, it flies around any obstacles until it arrives at a point B' directly above B.
山に遮られるので、蚊はまず標高 $f$ の地点 A' まで真上に飛びます。 次に、同じ標高 $f$ を保ったまま障害物を避けながら飛び、B の真上にある地点 B' まで飛びます。
First, determine $f_{min}$ which is the minimum constant elevation allowing such a trip from A to B, while remaining in the specified area. Then, find the length of the shortest path between A' and B', while flying at that constant elevation $f_{min}$.
まず、指定された領域内にとどまりながら上述のとおりに A から B へ移動できる、最小の一定の標高 $f_{min}$ を決定しなさい。 次に、その一定の標高 $f_{min}$ で飛びながら A' から B' へ移動するための最短経路の長さを求めなさい。
Give that length as your answer, rounded to three decimal places.
回答は、経路の長さを四捨五入して小数第 3 位まで示すこと。
**Note:** For convenience, the elevation function shown above is repeated below, in a form suitable for most programming languages: `h=( 5000-0.005*(x*x+y*y+x*y)+12.5*(x+y) )* exp( -abs(0.000001*(x*x+y*y)-0.0015*(x+y)+0.7) )`.
**:** 参考として、多くのプログラム言語に適した形で上述の標高関数を次に再掲します。`h=( 5000-0.005*(x*x+y*y+x*y)+12.5*(x+y) )* exp( -abs(0.000001*(x*x+y*y)-0.0015*(x+y)+0.7) )`
# --hints--
`mountainRange()` should return `2531.205`.
`mountainRange()` `2531.205` を返す必要があります。
```js
assert.strictEqual(mountainRange(), 2531.205);

View File

@ -1,6 +1,6 @@
---
id: 5900f4741000cf542c50ff86
title: 'Problem 263: An engineers'' dream come true'
title: '問題 263: エンジニアの夢がかなう'
challengeType: 5
forumTopicId: 301912
dashedName: problem-263-an-engineers-dream-come-true
@ -8,30 +8,30 @@ dashedName: problem-263-an-engineers-dream-come-true
# --description--
Consider the number 6. The divisors of 6 are: 1,2,3 and 6.
6 という数について考えます。 6 の約数は 1, 2, 3, 6 です。
Every number from 1 up to and including 6 can be written as a sum of distinct divisors of 6:
1 から 6 までのすべての数は、次のように 6 の相異なる約数の和として表せます。
$1 = 1$, $2 = 2$, $3 = 1 + 2$, $4 = 1 + 3$, $5 = 2 + 3$, $6 = 6$.
$1 = 1$, $2 = 2$, $3 = 1 + 2$, $4 = 1 + 3$, $5 = 2 + 3$, $6 = 6$
A number $n$ is called a practical number if every number from 1 up to and including $n$ can be expressed as a sum of distinct divisors of $n$.
1 から $n$ までのすべての数が $n$ の相異なる約数の和として表すことができる場合、 $n$ はプラクティカル数と呼ばれます。
A pair of consecutive prime numbers with a difference of six is called a sexy pair (since "sex" is the Latin word for "six"). The first sexy pair is (23, 29).
差が 6 である連続した素数のペアは、セクシーペアと呼ばれます ("six" はラテン語で "sex" なので) 。 最初のセクシーペアは (23, 29) です。
We may occasionally find a triple-pair, which means three consecutive sexy prime pairs, such that the second member of each pair is the first member of the next pair.
トリプルペアが見つかることがあります。トリプルペアとは、各ペアの 2 つ目の要素が次のペアの 1 つ目の要素になるような、3 つの連続したセクシーペアのことです。
We shall call a number $n$ such that:
次のような数 $n$ を考えます。
- ($n - 9$, $n - 3$), ($n - 3$, $n + 3$), ($n + 3$, $n + 9$) form a triple-pair, and
- the numbers $n - 8$, $n - 4$, $n$, $n + 4$ and $n + 8$ are all practical,
- ($n - 9$, $n - 3$), ($n - 3$, $n + 3$), ($n + 3$, $n + 9$) がトリプルペアになっている。かつ、
- $n - 8$, $n - 4$, $n$, $n + 4$, $n + 8$ がすべてプラクティカル数である。
an engineers paradise.
このような数を「エンジニアの楽園」と呼ぶことにします。
Find the sum of the first four engineers paradises.
エンジニアの楽園のうち最初の 4 つの和を求めなさい。
# --hints--
`engineersDreamComeTrue()` should return `2039506520`.
`engineersDreamComeTrue()` `2039506520` を返す必要があります。
```js
assert.strictEqual(engineersDreamComeTrue(), 2039506520);

View File

@ -1,6 +1,6 @@
---
id: 5900f4751000cf542c50ff87
title: 'Problem 264: Triangle Centres'
title: '問題 264: 三角形の中心'
challengeType: 5
forumTopicId: 301913
dashedName: problem-264-triangle-centres
@ -8,15 +8,15 @@ dashedName: problem-264-triangle-centres
# --description--
Consider all the triangles having:
以下が当てはまるすべての三角形について考えてます。
- All their vertices on lattice points.
- Circumcentre at the origin O.
- Orthocentre at the point H(5, 0).
- すべての頂点が格子点上にある。
- 外心が原点 O にある。
- 垂心が点 H (5, 0) にある。
There are nine such triangles having a $\text{perimeter} ≤ 50$.
$\text{周長} ≤ 50$ に対してこのような三角形は 9 つあります。
Listed and shown in ascending order of their perimeter, they are:
それらを下表に周長の昇順で示します。
<table>
<tbody>
@ -34,18 +34,18 @@ A(8, 1), B(1, -8), C(-4, 7)<br>
A(2, 9), B(9, -2), C(-6, -7)<br>
A(9, 2), B(2, -9), C(-6, 7)<br>
</td>
<td><img class="img-responsive center-block" alt="nine triangles ABC with perimeter ≤ 50" src="https://cdn.freecodecamp.org/curriculum/project-euler/triangle-centres.gif" style="background-color: white; padding: 10px;"></td>
<td><img class="img-responsive center-block" alt="周長が 50 以下の 9 つの三角形 ABC" src="https://cdn.freecodecamp.org/curriculum/project-euler/triangle-centres.gif" style="background-color: white; padding: 10px;"></td>
</tr>
</tbody>
</table>
The sum of their perimeters, rounded to four decimal places, is 291.0089.
これらの周長の和を小数第 4 位に四捨五入すると 291.0089 です。
Find all such triangles with a $\text{perimeter} ≤ {10}^5$. Enter as your answer the sum of their perimeters rounded to four decimal places.
$\text{周長} ≤ {10}^5$ を満たすこのような三角形をすべて求めなさい。 回答は、これらの三角形の周長の和を四捨五入して小数第 4 位まで示すこと。
# --hints--
`triangleCentres()` should return `2816417.1055`.
`triangleCentres()` `2816417.1055` を返す必要があります。
```js
assert.strictEqual(triangleCentres(), 2816417.1055);

View File

@ -1,6 +1,6 @@
---
id: 5900f4761000cf542c50ff88
title: 'Problem 265: Binary Circles'
title: '問題 265: 2 進数の円'
challengeType: 5
forumTopicId: 301914
dashedName: problem-265-binary-circles
@ -8,26 +8,26 @@ dashedName: problem-265-binary-circles
# --description--
$2^N$ binary digits can be placed in a circle so that all the $N$-digit clockwise subsequences are distinct.
2 進数の数字 $2^N$ 個を、時計回りの $N$ 桁の部分列がすべて相異なるように円形に並べることができます。
For $N = 3$, two such circular arrangements are possible, ignoring rotations:
$N = 3$のとき、回転を無視すればこのような円形の配置は 2 通りあります。
<img class="img-responsive center-block" alt="two circular arrangements for N = 3" src="https://cdn.freecodecamp.org/curriculum/project-euler/binary-circles.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="2 通りの円形配置 (N = 3)" src="https://cdn.freecodecamp.org/curriculum/project-euler/binary-circles.gif" style="background-color: white; padding: 10px;" />
For the first arrangement, the 3-digit subsequences, in clockwise order, are: 000, 001, 010, 101, 011, 111, 110 and 100.
1 つ目の配置では、3 桁の部分列は時計回りに 000, 001, 010, 101, 011, 111, 110, 100 です。
Each circular arrangement can be encoded as a number by concatenating the binary digits starting with the subsequence of all zeros as the most significant bits and proceeding clockwise. The two arrangements for $N = 3$ are thus represented as 23 and 29:
0 のみからなる部分列を最上位の数字としてそこから開始し、時計回りに 2 進法の数字をつなげていくと、それぞれの円形配置を 1 つの数に変換できます。 したがって、$N = 3$ のとき、上の 2 つの配置は次のように 23 および 29 として表されます。
$${00010111}_2 = 23\\\\
{00011101}_2 = 29$$
Calling $S(N)$ the sum of the unique numeric representations, we can see that $S(3) = 23 + 29 = 52$.
一意の数値表現の和を $S(N)$ とすると、$S(3) = 23 + 29 = 52$ であることが分かります。
Find $S(5)$.
$S(5)$ を求めなさい。
# --hints--
`binaryCircles()` should return `209110240768`.
`binaryCircles()` `209110240768` を返す必要があります。
```js
assert.strictEqual(binaryCircles(), 209110240768);

View File

@ -1,6 +1,6 @@
---
id: 5900f4771000cf542c50ff89
title: 'Problem 266: Pseudo Square Root'
title: '問題 266: 擬似平方根'
challengeType: 5
forumTopicId: 301915
dashedName: problem-266-pseudo-square-root
@ -8,19 +8,19 @@ dashedName: problem-266-pseudo-square-root
# --description--
The divisors of 12 are: 1,2,3,4,6 and 12.
12 の約数は 1, 2, 3, 4, 6, 12 です。
The largest divisor of 12 that does not exceed the square root of 12 is 3.
12 の平方根を超えない 12 の最大の約数は 3 です。
We shall call the largest divisor of an integer $n$ that does not exceed the square root of $n$ the pseudo square root ($PSR$) of $n$.
$n$ の平方根を超えないような整数 $n$ の最大の約数を、$n$ の「擬似平方根」 ($PSR$) と呼ぶことにします。
It can be seen that $PSR(3102) = 47$.
$PSR(3102) = 47$ であることが分かります。
Let $p$ be the product of the primes below 190. Find $PSR(p)\bmod {10}^{16}$.
$p$ を 190 未満の素数の積とします。 $PSR(p)\bmod {10}^{16} $ を求めなさい。
# --hints--
`pseudoSquareRoot()` should return `1096883702440585`.
`pseudoSquareRoot()` `1096883702440585` を返す必要があります。
```js
assert.strictEqual(pseudoSquareRoot(), 1096883702440585);

View File

@ -1,6 +1,6 @@
---
id: 5900f4771000cf542c50ff8a
title: 'Problem 267: Billionaire'
title: 'Problem 267: 億万長者'
challengeType: 5
forumTopicId: 301916
dashedName: problem-267-billionaire
@ -8,21 +8,21 @@ dashedName: problem-267-billionaire
# --description--
You are given a unique investment opportunity.
一風変わった投資機会が与えられます。
Starting with £1 of capital, you can choose a fixed proportion, $f$, of your capital to bet on a fair coin toss repeatedly for 1000 tosses.
1 ポンドの資金で始め、1000 回の公正なコイントスに対して繰り返し賭ける資金の固定比率 $f$ を選択します。
Your return is double your bet for heads and you lose your bet for tails.
表が出たら賭け金の倍額を稼ぎ、裏が出たら賭け金を失います。
For example, if $f = \frac{1}{4}$, for the first toss you bet £0.25, and if heads comes up you win £0.5 and so then have £1.5. You then bet £0.375 and if the second toss is tails, you have £1.125.
例えば、$f = \frac{1}{4}$の場合、最初のコイントスで 0.25 ポンドを賭け、表が出たら 0.5 ポンドを獲得するので、資金は 1.5 ポンドになります。 その後、0.375 ポンドを賭け、2 回目のトスが裏であれば資金は 1.125 ポンドになります。
Choosing $f$ to maximize your chances of having at least £1,000,000,000 after 1,000 flips, what is the chance that you become a billionaire?
1,000 回後に資金が少なくとも 1,000,000,000 ポンドになっている確率が最大になるような $f$ を選んだ場合に、資金が 1,000,000,000 ポンドになっている確率を求めなさい。
All computations are assumed to be exact (no rounding), but give your answer rounded to 12 digits behind the decimal point in the form 0.abcdefghijkl.
計算はすべて (四捨五入なしで) 厳密に行われることが想定されています。ただし回答は、四捨五入して小数第 12 位まで求め、0.abcdefghijkl の形式にすること。
# --hints--
`billionaire()` should return `0.999992836187`.
`billionaire()` `0.999992836187` を返す必要があります。
```js
assert.strictEqual(billionaire(), 0.999992836187);

View File

@ -1,7 +1,7 @@
---
id: 5900f4791000cf542c50ff8b
title: >-
Problem 268: Counting numbers with at least four distinct prime factors less than 100
問題 268: 相異なる 100 未満の素因数を少なくとも 4 つ持つ数を数え上げる
challengeType: 5
forumTopicId: 301917
dashedName: >-
@ -10,13 +10,13 @@ dashedName: >-
# --description--
It can be verified that there are 23 positive integers less than 1000 that are divisible by at least four distinct primes less than 100.
少なくとも 4 つの 100 未満の相異なる素数で割り切れる、1000 未満の正の整数が 23 個あることを確認できます。
Find how many positive integers less than ${10}^{16}$ are divisible by at least four distinct primes less than 100.
少なくとも 4 つの 100 未満の相異なる素数で割り切れる、${10}^{16}$ 未満の正の整数はいくつありますか。
# --hints--
`fourDistinctPrimeFactors()` should return `785478606870985`.
`fourDistinctPrimeFactors()` `785478606870985` を返す必要があります。
```js
assert.strictEqual(fourDistinctPrimeFactors(), 785478606870985);

View File

@ -1,6 +1,6 @@
---
id: 5900f4791000cf542c50ff8c
title: 'Problem 269: Polynomials with at least one integer root'
title: '問題 269: 少なくとも 1 つの整数根を持つ多項式'
challengeType: 5
forumTopicId: 301918
dashedName: problem-269-polynomials-with-at-least-one-integer-root
@ -8,27 +8,27 @@ dashedName: problem-269-polynomials-with-at-least-one-integer-root
# --description--
A root or zero of a polynomial $P(x)$ is a solution to the equation $P(x) = 0$.
多項式 $P(x)$ の根すなわち零点とは、式 $P(x) = 0$ の解です。
Define $P_n$ as the polynomial whose coefficients are the digits of $n$.
$P_n$ を多項式として定義し、その係数を $n$ の各位とします。
For example, $P_{5703}(x) = 5x^3 + 7x^2 + 3$.
例えば、$P_{5703}(x) = 5x^3 + 7x^2 + 3$ です。
We can see that:
次のことが分かります。
- $P_n(0)$ is the last digit of $n$,
- $P_n(1)$ is the sum of the digits of $n$,
- $Pn(10)$ is $n$ itself.
- $P_n(0)$ は $n$ の最下位の数字である。
- $P_n(1)$ は $n$ の各位の和である。
- $Pn(10)$ $n$ そのものである。
Define $Z(k)$ as the number of positive integers, $n$, not exceeding $k$ for which the polynomial $P_n$ has at least one integer root.
多項式 $P_n$ が少なくとも 1 つの整数根 (integer root) を持つような $k$ 以下の正の整数 $n$ の個数を、$Z(k)$とします。
It can be verified that $Z(100\\,000)$ is 14696.
$Z(100\\,000)$ 14696 であることを確認できます。
What is $Z({10}^{16})$?
$Z({10}^{16})$ を求めなさい。
# --hints--
`polynomialsWithOneIntegerRoot()` should return `1311109198529286`.
`polynomialsWithOneIntegerRoot()` `1311109198529286` を返す必要があります。
```js
assert.strictEqual(polynomialsWithOneIntegerRoot(), 1311109198529286);

View File

@ -1,6 +1,6 @@
---
id: 5900f47c1000cf542c50ff8e
title: 'Problem 270: Cutting Squares'
title: '問題 270: 正方形を切る'
challengeType: 5
forumTopicId: 301920
dashedName: problem-270-cutting-squares
@ -8,21 +8,21 @@ dashedName: problem-270-cutting-squares
# --description--
A square piece of paper with integer dimensions $N×N$ is placed with a corner at the origin and two of its sides along the $x$- and $y$-axes. Then, we cut it up respecting the following rules:
整数寸法 $N×N$ を持つ正方形の紙片が座標上に置かれています。角は原点にあり、辺は $x$ 軸と $y$ 軸に沿っています。 次に、以下のルールに従って紙を切ります。
- We only make straight cuts between two points lying on different sides of the square, and having integer coordinates.
- Two cuts cannot cross, but several cuts can meet at the same border point.
- Proceed until no more legal cuts can be made.
- 正方形の異なる辺上にあり整数座標を持つ 2 つの点の間のみを、まっすぐ切る。
- 2 本の切断線が交差してはいけないが、複数の切断線の端点が同じでも良い。
- ルールに従った切り方がそれ以上できなくなるまで続ける。
Counting any reflections or rotations as distinct, we call $C(N)$ the number of ways to cut an $N×N$ square. For example, $C(1) = 2$ and $C(2) = 30$ (shown below).
反転または回転した図もすべて相異なる切り方として数え、$N×N$ の正方形の切り方の数を $C(N)$ とします。 例えば、$C(1) = 2$ であり、$C(2) = 30$ です (下図参照)。
<img class="img-responsive center-block" alt="ways to cut 2x2 square, counting reflections and rotations as distinct" src="https://cdn.freecodecamp.org/curriculum/project-euler/cutting-squares.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="2x2 の正方形の切り方。反転・回転したものは相異なる切り方とされる" src="https://cdn.freecodecamp.org/curriculum/project-euler/cutting-squares.gif" style="background-color: white; padding: 10px;" />
What is $C(30)\bmod {10}^8$ ?
$C(30)\bmod {10}^8$ を求めなさい。
# --hints--
`cuttingSquares()` should return `82282080`.
`cuttingSquares()` `82282080` を返す必要があります。
```js
assert.strictEqual(cuttingSquares(), 82282080);

View File

@ -1,6 +1,6 @@
---
id: 5900f47b1000cf542c50ff8d
title: 'Problem 271: Modular Cubes, part 1'
title: '問題 272: モジュラー立方数 (1)'
challengeType: 5
forumTopicId: 301921
dashedName: problem-271-modular-cubes-part-1
@ -8,15 +8,15 @@ dashedName: problem-271-modular-cubes-part-1
# --description--
For a positive number $n$, define $S(n)$ as the sum of the integers $x$, for which $1 < x < n$ and $x^3 \equiv 1\bmod n$.
正の整数 $n$ について、$1 < x < n$ かつ $x^3 \equiv 1\bmod n$ であるような整数 $x$ の和を $S(n)$ とします
When $n = 91$, there are 8 possible values for $x$, namely: 9, 16, 22, 29, 53, 74, 79, 81. Thus, $S(91) = 9 + 16 + 22 + 29 + 53 + 74 + 79 + 81 = 363$.
$n = 91$ のとき考えられる $x$ の値は 9, 16, 22, 29, 53, 74, 79, 81 8 つです したがって$S(91) = 9 + 16 + 22 + 29 + 53 + 74 + 79 + 81 = 363$ です
Find $S(13\\,082\\,761\\,331\\,670\\,030)$.
$S(13\\,082\\,761\\,331\\,670\\,030)$ を求めなさい
# --hints--
`modularCubesOne()` should return `4617456485273130000`.
`modularCubesOne()` `4617456485273130000` を返す必要があります
```js
assert.strictEqual(modularCubesOne(), 4617456485273130000);

View File

@ -1,6 +1,6 @@
---
id: 5900f47d1000cf542c50ff8f
title: 'Problem 272: Modular Cubes, part 2'
title: '問題 272: モジュラー立方数 (2)'
challengeType: 5
forumTopicId: 301922
dashedName: problem-272-modular-cubes-part-2
@ -8,15 +8,15 @@ dashedName: problem-272-modular-cubes-part-2
# --description--
For a positive number $n$, define $C(n)$ as the number of the integers $x$, for which $1 < x < n$ and $x^3 \equiv 1\bmod n$.
正の整数 $n$ について、$1 < x < n$ かつ $x^3 \equiv 1\bmod n$ であるような整数 $x$ の個数を $C(n)$ とします
When $n = 91$, there are 8 possible values for $x$, namely: 9, 16, 22, 29, 53, 74, 79, 81. Thus, $C(91) = 8$.
$n = 91$ のとき考えられる $x$ の値は 9, 16, 22, 29, 53, 74, 79, 81 8 つです したがって$C(91) = 8$ です
Find the sum of the positive numbers $n {10}^{11}$ for which $C(n)=242$.
$C(n)=242$ となる正の整数 $n {10}^{11}$ の和を求めなさい
# --hints--
`modularCubesTwo()` should return `8495585919506151000`.
`modularCubesTwo()` `8495585919506151000` を返す必要があります
```js
assert.strictEqual(modularCubesTwo(), 8495585919506151000);

View File

@ -1,6 +1,6 @@
---
id: 5900f47e1000cf542c50ff90
title: 'Problem 273: Sum of Squares'
title: '問題 273: 平方数の和'
challengeType: 5
forumTopicId: 301923
dashedName: problem-273-sum-of-squares
@ -8,21 +8,21 @@ dashedName: problem-273-sum-of-squares
# --description--
Consider equations of the form: $a^2 + b^2 = N$, $0 ≤ a ≤ b$, $a$, $b$ and $N$ integer.
$a^2 + b^2 = N$, $0 ≤ a ≤ b$ ($a$, $b$, $N$ は整数) について考えます。
For $N = 65$ there are two solutions:
$N = 65$ のとき、解は 2 つあります。
$a = 1, b = 8$ and $a = 4, b = 7$.
$a = 1, b = 8$ と、$a = 4, b = 7$ です。
We call $S(N)$ the sum of the values of $a$ of all solutions of $a^2 + b^2 = N$, $0 ≤ a ≤ b$, $a$, $b$ and $N$ integer.
$a^2 + b^2 = N$, $0 ≤ a ≤ b$ ($a$, $b$, $N$ は整数) のすべての解の $a$ 値の和を $S(N)$ とします。
Thus $S(65) = 1 + 4 = 5$.
したがって、$S(65) = 1 + 4 = 5$ です。
Find $\sum S(N)$, for all squarefree $N$ only divisible by primes of the form $4k + 1$ with $4k + 1 &lt; 150$.
$4k + 1 &lt; 150$ のとき、$4k + 1$ で表される素数でのみ割り切れるすべての無平方数 $N$ について $\sum S(N)$ を求めなさい。
# --hints--
`sumOfSquares()` should return `2032447591196869000`.
`sumOfSquares()` `2032447591196869000` を返す必要があります。
```js
assert.strictEqual(sumOfSquares(), 2032447591196869000);

View File

@ -1,6 +1,6 @@
---
id: 5900f47f1000cf542c50ff91
title: 'Problem 274: Divisibility Multipliers'
title: '問題 274: 整除乗数'
challengeType: 5
forumTopicId: 301924
dashedName: problem-274-divisibility-multipliers
@ -8,25 +8,25 @@ dashedName: problem-274-divisibility-multipliers
# --description--
For each integer $p > 1$ coprime to 10 there is a positive divisibility multiplier $m &lt; p$ which preserves divisibility by $p$ for the following function on any positive integer, $n$:
10 と互いに素な整数 $p > 1$ のそれぞれについて、任意の正の整数 $n$ の $p$ での整除性が次の関数に対しても維持されるような、正の整除乗数 (divisibility multiplier) $m &lt; p$ が存在します。
$f(n) = (\text{all but the last digit of} \\; n) + (\text{the last digit of} \\; n) \times m$
$f(n) = (\\; n {\text{の最下位の桁以外すべて}) + (\\; n \text{の最下位の桁}) \times m$
That is, if $m$ is the divisibility multiplier for $p$, then $f(n)$ is divisible by $p$ if and only if $n$ is divisible by $p$.
つまり、$m$ が $p$ の整除乗数である場合、$f(n) が $p$ で整除できるための必要十分条件は $n$ が $p$ で整除できることです。
(When $n$ is much larger than $p$, $f(n)$ will be less than $n$ and repeated application of $f$ provides a multiplicative divisibility test for $p$.)
($n$ が $p$よりもはるかに大きい場合、$f(n)$ は $n$ よりも小さくなり、$f$ を繰り返し適用することで $p$ の乗法整除性を検証できます。)
For example, the divisibility multiplier for 113 is 34.
例えば、113 の 整除乗数は 34 です。
$f(76275) = 7627 + 5 \times 34 = 7797$: 76275 and 7797 are both divisible by 113
$f(76275) = 7627 + 5 \times 34 = 7797$: 76275 77977 はいずれも 113 で割り切れます。
$f(12345) = 1234 + 5 \times 34 = 1404$: 12345 and 1404 are both not divisible by 113
$f(12345) = 1234 + 5 \times 34 = 1404$: 12345 14047 はいずれも 113 で割り切れません。
The sum of the divisibility multipliers for the primes that are coprime to 10 and less than 1000 is 39517. What is the sum of the divisibility multipliers for the primes that are coprime to 10 and less than ${10}^7$?
10 と互いに素な 1000 未満の素数の、整除乗数の和は 39517 です。 10 と互いに素な ${10}^7$ 未満の素数の、整除乗数の和を求めなさい。
# --hints--
`divisibilityMultipliers()` should return `1601912348822`.
`divisibilityMultipliers()` `1601912348822` を返す必要があります。
```js
assert.strictEqual(divisibilityMultipliers(), 1601912348822);

View File

@ -1,6 +1,6 @@
---
id: 5900f4801000cf542c50ff92
title: 'Problem 275: Balanced Sculptures'
title: '問題 275: 平衡な彫像'
challengeType: 5
forumTopicId: 301925
dashedName: problem-275-balanced-sculptures
@ -8,24 +8,24 @@ dashedName: problem-275-balanced-sculptures
# --description--
Let us define a balanced sculpture of order $n$ as follows:
位数 $n$ の平衡な彫像を次のように定義します。
- A polyomino made up of $n + 1$ tiles known as the blocks ($n$ tiles) and the plinth (remaining tile);
- the plinth has its centre at position ($x = 0$, $y = 0$);
- the blocks have $y$-coordinates greater than zero (so the plinth is the unique lowest tile);
- the centre of mass of all the blocks, combined, has $x$-coordinate equal to zero.
- ブロック ($n$ 枚のタイル) と台座 (残りのタイル) として知られる $n + 1$ 枚のタイルで構成されたポリオミノである。
- 台座の中心は ($x = 0$, $y = 0$) に位置する。
- ブロックの $y$ 座標は 0 より大きい (したがって台座は唯一の一番下のタイル)。
- すべてのブロックを合わせたときの重心の $x$ 座標は 0 に等しい。
When counting the sculptures, any arrangements which are simply reflections about the $y$-axis, are <u>not</u> counted as distinct. For example, the 18 balanced sculptures of order 6 are shown below; note that each pair of mirror images (about the $y$-axis) is counted as one sculpture:
彫像を数えるとき、単に $y$ 軸で反転させた配置は区別<u>されません</u>。 例えば、位数 6 の平衡な彫像 18 個を下に示します。($y$ 軸で反転して) 鏡像となる各ペアが 1 つの彫像としてカウントされることに注意してください。
<img class="img-responsive center-block" alt="18 balanced sculptures of order 6" src="https://cdn.freecodecamp.org/curriculum/project-euler/balanced-sculptures.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="位数 6 に対する 18 個の平衡な彫像" src="https://cdn.freecodecamp.org/curriculum/project-euler/balanced-sculptures.gif" style="background-color: white; padding: 10px;" />
There are 964 balanced sculptures of order 10 and 360505 of order 15.
位数 10 の平衡な彫像は 964 個、位数 15 の平衡な彫像は 360505 個あります。
How many balanced sculptures are there of order 18?
位数 18 の平衡な彫像はいくつありますか。
# --hints--
`balancedSculptures()` should return `15030564`.
`balancedSculptures()` `15030564` を返す必要があります。
```js
assert.strictEqual(balancedSculptures(), 15030564);

View File

@ -1,6 +1,6 @@
---
id: 5900f4801000cf542c50ff93
title: 'Problem 276: Primitive Triangles'
title: '問題 276: 原始的な三角形'
challengeType: 5
forumTopicId: 301926
dashedName: problem-276-primitive-triangles
@ -8,15 +8,15 @@ dashedName: problem-276-primitive-triangles
# --description--
Consider the triangles with integer sides $a$, $b$ and $c$ with $a ≤ b ≤ c$.
整数辺 $a$, $b$, $c$ ($a ≤ b ≤ c$) を持つ三角形を考えます。
An integer sided triangle $(a,b,c)$ is called primitive if $gcd(a,b,c) = 1$.
$gcd(a,b,c) = 1$ が成り立つとき、整数辺を持つ三角形 $(a,b,c)$ は「原始的」(primitive) であると呼ばれます。
How many primitive integer sided triangles exist with a perimeter not exceeding $10\\,000\\,000$?
周長が $10\\,000\\,000$ 以下、辺長が整数、かつ原始的である三角形はいくつありますか。
# --hints--
`primitiveTriangles()` should return `5777137137739633000`.
`primitiveTriangles()` `5777137137739633000` を返す必要があります。
```js
assert.strictEqual(primitiveTriangles(), 5777137137739633000);

View File

@ -1,6 +1,6 @@
---
id: 5900f4811000cf542c50ff94
title: 'Problem 277: A Modified Collatz sequence'
title: '問題 277: 変形コラッツ数列'
challengeType: 5
forumTopicId: 301927
dashedName: problem-277-a-modified-collatz-sequence
@ -8,29 +8,29 @@ dashedName: problem-277-a-modified-collatz-sequence
# --description--
A modified Collatz sequence of integers is obtained from a starting value $a_1$ in the following way:
整数の変形コラッツ列は、開始値 $a_1$ から次のようにして得られます。
$a_{n + 1} = \frac{a_n}{3}$ if $a_n$ is divisible by 3. We shall denote this as a large downward step, "D".
$a_n$ が 3 で割り切れる場合、$a_{n + 1} = \frac{a_n}{3}$ です。 これを、大きな下向きのステップ "D"と表すことにします。
$a_{n + 1} = \frac{4a_n + 2}{3}$ if $a_n$ divided by 3 gives a remainder of 1. We shall denote this as an upward step, "U".
$a_n$ を 3 で割ると 1 余る場合、$a_{n + 1} = \frac{4a_n + 2}{3}$ です。 これを、大きな上向きのステップ "U" と表すことにします。
$a_{n + 1} = \frac{2a_n - 1}{3}$ if $a_n$ divided by 3 gives a remainder of 2. We shall denote this as a small downward step, "d".
$a_n$ を 3 で割ると 2 余る場合、$a_{n + 1} = \frac{2a_n - 1}{3}$ です。 これを、小さな下向きのステップ "d" と表すことにします。
The sequence terminates when some $a_n = 1$.
この数列は $a_n = 1$ のときに終了します。
Given any integer, we can list out the sequence of steps. For instance if $a_1 = 231$, then the sequence $\\{a_n\\} = \\{231, 77, 51, 17, 11, 7, 10, 14, 9, 3, 1\\}$ corresponds to the steps "DdDddUUdDD".
任意の整数について、ステップの数列を列挙できます。 例えば $a_1 = 231$ の場合、数列 $\\{a_n\\} = \\{231, 77, 51, 17, 11, 7, 10, 14, 9, 3, 1\\}$ "DdDddUUdDD" に相当します。
Of course, there are other sequences that begin with that same sequence "DdDddUUdDD....".
もちろん、同じ数列 "DdDddUUdDD...." で始まる数列は他にもあります。
For instance, if $a_1 = 1004064$, then the sequence is DdDddUUdDDDdUDUUUdDdUUDDDUdDD.
例えば、$a_1 = 1004064$ の場合、数列は DdDddUUdDDDdUDUUUdDdUUDDDUdDD です。
In fact, 1004064 is the smallest possible $a_1 > {10}^6$ that begins with the sequence DdDddUUdDD.
実は、1004064 は数列 DdDddUUdDD から始まる最小の $a_1 > {10}^6$ です。
What is the smallest $a_1 > {10}^{15}$ that begins with the sequence "UDDDUdddDDUDDddDdDddDDUDDdUUDd"?
"UDDDUdddDDUDDddDdDddDDUDDdUUDd" で始まる最小の $a_1 > {10}^{15}$を求めなさい。
# --hints--
`modifiedCollatzSequence()` should return `1125977393124310`.
`modifiedCollatzSequence()` `1125977393124310` を返す必要があります。
```js
assert.strictEqual(modifiedCollatzSequence(), 1125977393124310);

View File

@ -1,6 +1,6 @@
---
id: 5900f4831000cf542c50ff95
title: 'Problem 278: Linear Combinations of Semiprimes'
title: '問題 278: 半素数の線型結合'
challengeType: 5
forumTopicId: 301928
dashedName: problem-278-linear-combinations-of-semiprimes
@ -8,17 +8,17 @@ dashedName: problem-278-linear-combinations-of-semiprimes
# --description--
Given the values of integers $1 &lt; a_1 &lt; a_2 &lt; \ldots &lt; a_n$, consider the linear combination $q_1a_1 + q_2a_2 + \ldots + q_na_n = b$, using only integer values $q_k ≥ 0$.
整数 $1 &lt; a_1 &lt; a_2 &lt; \ldots &lt; a_n$ について、整数値 $q_k ≥ 0$ のみを使った線形結合 $q_1a_1 + q_2a_2 + \ldots + q_na_n = b$ を考えます。
Note that for a given set of $a_k$, it may be that not all values of $b$ are possible. For instance, if $a_1 = 5$ and $a_2 = 7$, there are no $q_1 ≥ 0$ and $q_2 ≥ 0$ such that $b$ could be 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 or 23.
なお、与えられた $a_k$ の組に対し、すべての $b$ 値が可能とは限りません。 例えば、$a_1 = 5$ かつ $a_2 = 7$ の場合、$b$ が 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18, 23 のいずれかになり得るような $q_1 ≥ 0$ と $q_2 ≥ 0$ は存在しません。
In fact, 23 is the largest impossible value of $b$ for $a_1 = 5$ and $a_2 = 7$. We therefore call $f(5, 7) = 23$. Similarly, it can be shown that $f(6, 10, 15)=29$ and $f(14, 22, 77) = 195$.
実際、$a_1 = 5$ かつ $a_2 = 7$ に対して $b$ 値になり得ない最大の数は 23 です。 これを $f(5, 7) = 23$ と定義します。 同様に、$f(6, 10, 15) = 29$ および $f(14, 22, 77) = 195$ であることを示せます。
Find $\sum f(pq,pr,qr)$, where $p$, $q$ and $r$ are prime numbers and $p &lt; q &lt; r &lt; 5000$.
$p$, $q$, $r$ が素数であり $p &lt; q &lt; r &lt; 5000$ のとき、$\sum f(pq,pr,qr)$ を求めなさい。
# --hints--
`linearCombinationOfSemiprimes()` should return `1228215747273908500`.
`linearCombinationOfSemiprimes()` `1228215747273908500` を返す必要があります。
```js
assert.strictEqual(linearCombinationOfSemiprimes(), 1228215747273908500);

View File

@ -1,6 +1,6 @@
---
id: 5900f4841000cf542c50ff96
title: 'Problem 279: Triangles with integral sides and an integral angle'
title: '問題 279: 辺と角度が整数である三角形'
challengeType: 5
forumTopicId: 301929
dashedName: problem-279-triangles-with-integral-sides-and-an-integral-angle
@ -8,11 +8,11 @@ dashedName: problem-279-triangles-with-integral-sides-and-an-integral-angle
# --description--
How many triangles are there with integral sides, at least one integral angle (measured in degrees), and a perimeter that does not exceed ${10}^8$?
3 辺の長さが整数であり、少なくとも 1 つの角度 (度単位で測定) が整数であり、かつ、周長が ${10}^8$ を超えない三角形はいくつありますか。
# --hints--
`trianglesWithIntegralSidesAndAngle()` should return `416577688`.
`trianglesWithIntegralSidesAndAngle()` `416577688` を返す必要があります。
```js
assert.strictEqual(trianglesWithIntegralSidesAndAngle(), 416577688);

View File

@ -1,6 +1,6 @@
---
id: 5900f4841000cf542c50ff97
title: 'Problem 280: Ant and seeds'
title: '問題 280: アリと種'
challengeType: 5
forumTopicId: 301931
dashedName: problem-280-ant-and-seeds
@ -8,15 +8,15 @@ dashedName: problem-280-ant-and-seeds
# --description--
A laborious ant walks randomly on a 5x5 grid. The walk starts from the central square. At each step, the ant moves to an adjacent square at random, without leaving the grid; thus there are 2, 3 or 4 possible moves at each step depending on the ant's position.
働き者のアリが 5x5 の格子上を不規則に歩きます。 中央のマスから出発します。 各ステップで、アリは格子を離れることなく、不規則に隣のマスに移動します。したがって、アリの位置に応じて各ステップで 2 通り、3 通り、または 4 通りの動き方があります。
At the start of the walk, a seed is placed on each square of the lower row. When the ant isn't carrying a seed and reaches a square of the lower row containing a seed, it will start to carry the seed. The ant will drop the seed on the first empty square of the upper row it eventually reaches.
アリが歩き始めると、より下の列の各マスに種が置かれます。 種の運搬中でないアリは、より下の列の、種のあるマスに達すると種を運び始めます。 そして、最終的に到達する、より上の列にある最初の空のマスに種を下ろします。
What's the expected number of steps until all seeds have been dropped in the top row? Give your answer rounded to 6 decimal places.
すべての種が最上列に下ろされるまでの期待ステップ数を求めなさい。 回答は、四捨五入して小数第 6 位まで示すこと。
# --hints--
`antAndSeeds()` should return `430.088247`.
`antAndSeeds()` `430.088247` を返す必要があります。
```js
assert.strictEqual(antAndSeeds(), 430.088247);

View File

@ -1,6 +1,6 @@
---
id: 5900f4861000cf542c50ff98
title: 'Problem 281: Pizza Toppings'
title: '問題 281: ピザのトッピング'
challengeType: 5
forumTopicId: 301932
dashedName: problem-281-pizza-toppings
@ -8,19 +8,19 @@ dashedName: problem-281-pizza-toppings
# --description--
You are given a pizza (perfect circle) that has been cut into $m·n$ equal pieces and you want to have exactly one topping on each slice.
ピザ (完全な円) を $m·n$ 枚のスライスに等分し、各スライスにちょうど 1 つずつトッピングを載せます。
Let $f(m,n)$ denote the number of ways you can have toppings on the pizza with $m$ different toppings ($m2$), using each topping on exactly $n$ slices ($n1$). Reflections are considered distinct, rotations are not.
ちょうど $n$ 枚のスライス ($n1$) にそれぞれのトッピングを使って、$m$ 種類のトッピング ($m2$) でピザにトッピングを載せる方法が何通りあるかを、$f(m,n)$ で表します。 反転させたものは相異なるとみなされますが、回転させたものは同一とみなされます。
Thus, for instance, $f(2,1) = 1$, $f(2,2) = f(3,1) = 2$ and $f(3,2) = 16$. $f(3,2)$ is shown below:
例えば、$f(2,1) = 1$, $f(2,2) = f(3,1) = 2$, $f(3,2) = 16$ です。 $f(3,2)$ を下に示します。
<img class="img-responsive center-block" alt="animation with 16 ways to have 3 different toppings on 2 slices each" src="https://cdn.freecodecamp.org/curriculum/project-euler/pizza-toppings.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="3 種類のトッピングを各 2 枚のスライスに載せる 16 通りの方法を示すアニメーション" src="https://cdn.freecodecamp.org/curriculum/project-euler/pizza-toppings.gif" style="background-color: white; padding: 10px;" />
Find the sum of all $f(m,n)$ such that $f(m,n) ≤ {10}^{15}$.
$f(m,n) ≤ {10}^{15}$ となる $f(m,n)$ の総和を求めなさい。
# --hints--
`pizzaToppings()` should return `1485776387445623`.
`pizzaToppings()` `1485776387445623` を返す必要があります。
```js
assert.strictEqual(pizzaToppings(), 1485776387445623);

View File

@ -1,6 +1,6 @@
---
id: 5900f4861000cf542c50ff99
title: 'Problem 282: The Ackermann function'
title: '問題 282: アッカーマン関数'
challengeType: 5
forumTopicId: 301933
dashedName: problem-282-the-ackermann-function
@ -8,17 +8,17 @@ dashedName: problem-282-the-ackermann-function
# --description--
For non-negative integers $m$, $n$, the Ackermann function $A(m, n)$ is defined as follows:
負でない整数 $m$, $n$ に対して、アッカーマン関数 $A(m, n)$ は次のように定義されます。
$$A(m, n) = \begin{cases} n + 1 & \text{if $m = 0$} \\\\ A(m - 1, 1) & \text{if $m > 0$ and $n = 0$} \\\\ A(m - 1, A(m, n - 1)) & \text{if $m > 0$ and $n > 0$} \end{cases}$$
$$A(m, n) = \begin{cases} n + 1 & \text{$m = 0$ の場合} \\\\ A(m - 1, 1) & \text{$m > 0$ かつ $n = 0$ の場合} \\\\ A(m - 1, A(m, n - 1)) & \text{$m > 0$ かつ $n > 0$ の場合} \end{cases}$$
For example $A(1, 0) = 2$, $A(2, 2) = 7$ and $A(3, 4) = 125$.
例えば、$A(1, 0) = 2$, $A(2, 2) = 7$, $A(3, 4) = 125$ です。
Find $\displaystyle\sum_{n = 0}^6 A(n, n)$ and give your answer mod ${14}^8$.
$\displaystyle\sum_{n = 0}^6 A(n, n)$ を求め、mod ${14}^8$ で答えなさい。
# --hints--
`ackermanFunction()` should return `1098988351`.
`ackermanFunction()` `1098988351` を返す必要があります。
```js
assert.strictEqual(ackermanFunction(), 1098988351);

View File

@ -1,7 +1,7 @@
---
id: 5900f4881000cf542c50ff9a
title: >-
Problem 283: Integer sided triangles for which the area / perimeter ratio is integral
問題 283: 面積 / 周長の比率が整数である整数辺三角形
challengeType: 5
forumTopicId: 301934
dashedName: >-
@ -10,19 +10,19 @@ dashedName: >-
# --description--
Consider the triangle with sides 6, 8 and 10. It can be seen that the perimeter and the area are both equal to 24.
辺の長さが 6, 8, 10 である三角形について考えます。 周長と面積がともに 24 に等しいことが分かります。
So the $\frac{\text{area}}{\text{perimeter}}$ ratio is equal to 1.
したがって、$\frac{\text{面積}}{\text{周長}}$ の比率は 1 です。
Consider also the triangle with sides 13, 14 and 15. The perimeter equals 42 while the area is equal to 84.
辺 13, 14, 15 の三角形についても考えます。 周長は 42、面積は 84 です。
So for this triangle the $\frac{\text{area}}{\text{perimeter}}$ ratio is equal to 2.
したがって、この三角形の $\frac{\text{面積}}{\text{周長}}$ の比率は 2 です。
Find the sum of the perimeters of all integer sided triangles for which the area/perimeter ratios are equal to positive integers not exceeding 1000.
面積 / 周長の比率が 1000 以下の正の整数に等しくなるようなすべての整数三角形について、それらの周長の和を求めなさい。
# --hints--
`integralAreaPerimeterRatio()` should return `28038042525570324`.
`integralAreaPerimeterRatio()` `28038042525570324` を返す必要があります。
```js
assert.strictEqual(integralAreaPerimeterRatio(), 28038042525570324);

View File

@ -1,6 +1,6 @@
---
id: 5900f4891000cf542c50ff9b
title: 'Problem 284: Steady Squares'
title: '問題 284: 安定平方数'
challengeType: 5
forumTopicId: 301935
dashedName: problem-284-steady-squares
@ -8,23 +8,23 @@ dashedName: problem-284-steady-squares
# --description--
The 3-digit number 376 in the decimal numbering system is an example of numbers with the special property that its square ends with the same digits: ${376}^2 = 141376$. Let's call a number with this property a steady square.
3 桁の 10 進数 376 は、その平方数の下位桁がそれ自体と同じである (${376}^2 = 141376$) という、特殊な性質を持つ数の一例です。 この性質を持つ数を「安定平方数」と呼ぶことにします。
Steady squares can also be observed in other numbering systems. In the base 14 numbering system, the 3-digit number $c37$ is also a steady square: $c37^2 = aa0c37$, and the sum of its digits is $c+3+7=18$ in the same numbering system. The letters $a$, $b$, $c$ and $d$ are used for the 10, 11, 12 and 13 digits respectively, in a manner similar to the hexadecimal numbering system.
安定平方数は他の進数でも現れます。 3 桁の14 進数 $c37$ も安定平方数であり、$c37^2 = aa0c37$ となります。また、その各位の和は 14 進数で $c+3+7=18$ です。 文字 $a$, $b$, $c$, $d$ はそれぞれ 10, 11, 12, 13 を表すのに使われます。これは 16 進数と同様の方法です。
For $1 ≤ n ≤ 9$, the sum of the digits of all the $n$-digit steady squares in the base 14 numbering system is $2d8$ (582 decimal). Steady squares with leading 0's are not allowed.
$1 ≤ n ≤ 9$ のとき、すべての $n$ 桁の 14 進数の安定平方数の各位の和は $2d8$ (10 進数で 582) です。 先行ゼロを持つ安定平方数は許容されません。
Find the sum of the digits of all the $n$-digit steady squares in the base 14 numbering system for $1 ≤ n ≤ 10000$ (decimal) and give your answer as a string in the base 14 system using lower case letters where necessary.
$1 ≤ n ≤ 10000$ (10進数) のとき、$n$ 桁の安定平方数 (14 進数) のすべてについて各位の和を求め、適宜、小文字の文字を使用して 14 進数の文字列で答えなさい。
# --hints--
`steadySquares()` should return a string.
`steadySquares()` は文字列を返す必要があります。
```js
assert(typeof steadySquares() === 'string');
```
`steadySquares()` should return the string `5a411d7b`.
`steadySquares()` は文字列 `5a411d7b` を返す必要があります。
```js
assert.strictEqual(steadySquares(), '5a411d7b');

View File

@ -1,6 +1,6 @@
---
id: 5900f48a1000cf542c50ff9c
title: 'Problem 285: Pythagorean odds'
title: '問題 285: ピタゴラスオッズ'
challengeType: 5
forumTopicId: 301936
dashedName: problem-285-pythagorean-odds
@ -8,19 +8,19 @@ dashedName: problem-285-pythagorean-odds
# --description--
Albert chooses a positive integer $k$, then two real numbers $a$, $b$ are randomly chosen in the interval [0,1] with uniform distribution.
アルバートが正の整数 $k$ を 1 つ選ぶと、一様分布の区間 [0,1] から 2 つの実数 $a$, $b$ が無作為に選ばれます。
The square root of the sum ${(ka + 1)}^2 + {(kb + 1)}^2$ is then computed and rounded to the nearest integer. If the result is equal to $k$, he scores $k$ points; otherwise he scores nothing.
次に、和 ${(ka + 1)}^2 + {(kb + 1)}^2$ の平方根が計算され、最も近い整数に丸められます。 結果が $k$ に等しければ $k$ 点を獲得し、それ以外は 0 点です。
For example, if $k = 6$, $a = 0.2$ and $b = 0.85$, then ${(ka + 1)}^2 + {(kb + 1)}^2 = 42.05$. The square root of 42.05 is 6.484... and when rounded to the nearest integer, it becomes 6. This is equal to $k$, so he scores 6 points.
例えば、$k = 6$, $a = 0.2$, $b = 0.85$ の場合、${(ka + 1)}^2 + {(kb + 1)}^2 = 42.05$ です。 42.05 の平方根は 6.484... で、最も近い整数に四捨五入すると 6 になります。 これは $k$ に等しいので、6 点を獲得します。
It can be shown that if he plays 10 turns with $k = 1, k = 2, \ldots, k = 10$, the expected value of his total score, rounded to five decimal places, is 10.20914.
$k = 1, k = 2, \ldots, k = 10$ として 10 回プレイした場合の合計点の期待値は 10.20914 (小数第 5 位に四捨五入) である、ということを示せます。
If he plays ${10}^5$ turns with $k = 1, k = 2, k = 3, \ldots, k = {10}^5$, what is the expected value of his total score, rounded to five decimal places?
$k = 1, k = 2, k = 3, \ldots, k = {10}^5$ として ${10}^5$ 回プレイした場合の合計点の期待値を、四捨五入して小数第 5 位まで求めなさい。
# --hints--
`pythagoreanOdds()` should return `157055.80999`.
`pythagoreanOdds()` `157055.80999` を返す必要があります。
```js
assert.strictEqual(pythagoreanOdds(), 157055.80999);

View File

@ -1,6 +1,6 @@
---
id: 5900f48a1000cf542c50ff9d
title: 'Problem 286: Scoring probabilities'
title: '問題 286: 得点の確率'
challengeType: 5
forumTopicId: 301937
dashedName: problem-286-scoring-probabilities
@ -8,15 +8,15 @@ dashedName: problem-286-scoring-probabilities
# --description--
Barbara is a mathematician and a basketball player. She has found that the probability of scoring a point when shooting from a distance $x$ is exactly ($1 - \frac{x}{q}$), where $q$ is a real constant greater than 50.
バーバラは数学者で、バスケットボール選手でもあります。 彼女は、距離 $x$ からシュートしたときに 1 点取れる確率がちょうど ($1 - \frac{x}{q}$) であること気付きました。ここで、$q$ は 50 よりも大きい実数定数です。
During each practice run, she takes shots from distances $x = 1, x = 2, \ldots, x = 50$ and, according to her records, she has precisely a 2 % chance to score a total of exactly 20 points.
1 回の練習ごとにそれぞれ距離 $x = 1, x = 2, \ldots, x = 50$ からシュートし、記録によると、合計がちょうど 20 点になる確率はちょうど 2% です。
Find $q$ and give your answer rounded to 10 decimal places.
$q$ を求め、四捨五入して小数点以下 10 桁まで示しなさい。
# --hints--
`scoringProbabilities()` should return `52.6494571953`.
`scoringProbabilities()` `52.6494571953` を返す必要があります。
```js
assert.strictEqual(scoringProbabilities(), 52.6494571953);

View File

@ -1,6 +1,6 @@
---
id: 5900f48b1000cf542c50ff9e
title: 'Problem 287: Quadtree encoding (a simple compression algorithm)'
title: '問題 287: 四分木符号化 (単純な圧縮アルゴリズム)'
challengeType: 5
forumTopicId: 301938
dashedName: problem-287-quadtree-encoding-a-simple-compression-algorithm
@ -8,32 +8,32 @@ dashedName: problem-287-quadtree-encoding-a-simple-compression-algorithm
# --description--
The quadtree encoding allows us to describe a $2^N×2^N$ black and white image as a sequence of bits (0 and 1). Those sequences are to be read from left to right like this:
四分木符号化により、$2^N×2^N$ の白黒画像をビット (0, 1) 列で表すことができます。 このビット列は、左から右へ次のように解釈されます。
- the first bit deals with the complete $2^N×2^N$ region;
- "0" denotes a split:
- the current $2^n×2^n$ region is divided into 4 sub-regions of dimension $2^{n - 1}×2^{n - 1}$,
- the next bits contains the description of the top left, top right, bottom left and bottom right sub-regions - in that order;
- "10" indicates that the current region contains only black pixels;
- "11" indicates that the current region contains only white pixels.
- 最初のビットは $2^N×2^N$ の領域全体を表します。
- "0" は分割を意味します。
- 現在の $2^n×2^n$ の領域は、寸法 $2^{n - 1}×2^{n - 1}$ の 4 つの部分領域に分割されます。
- 次のビットには、左上、右上、左下、右下の部分領域の説明がこの順序で含まれています。
- "10" は、現在の領域が黒いピクセルのみを含んでいることを示します。
- "11" は、現在の領域が白いピクセルのみを含んでいることを示します。
Consider the following 4×4 image (colored marks denote places where a split can occur):
次の 4×4 の画像について考えます (色付きのマークは分割可能な場所を示します)。
<img class="img-responsive center-block" alt="4x4 image with colored marks denoting place where split can occur" src="https://cdn.freecodecamp.org/curriculum/project-euler/quadtree-encoding-a-simple-compression-algorithm.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="分割可能な場所が色付きマークで示されている 4x4 の画像" src="https://cdn.freecodecamp.org/curriculum/project-euler/quadtree-encoding-a-simple-compression-algorithm.gif" style="background-color: white; padding: 10px;" />
This image can be described by several sequences, for example : "<strong><span style="color: red">0</span></strong><strong><span style="color: blue">0</span></strong>10101010<strong><span style="color: green">0</span></strong>1011111011<strong><span style="color: orange">0</span></strong>10101010", of length 30, or "<strong><span style="color: red">0</span></strong>10<strong><span style="color: green">0</span></strong>101111101110", of length 16, which is the minimal sequence for this image.
この画像は、例えば次のようにいくつかの数列で表すことができます。"<strong><span style="color: red">0</span></strong><strong><span style="color: blue">0</span></strong>10101010<strong><span style="color: green">0</span></strong>1011111011<strong><span style="color: orange">0</span></strong>10101010" (長さ 30)、または "<strong><span style="color: red">0</span></strong>10<strong><span style="color: green">0</span></strong>101111101110" (長さ 16、この画像での最小数列)
For a positive integer $N$, define $D_N$ as the $2^N×2^N$ image with the following coloring scheme:
正の整数 $N$ に対し、次のように色が付く $2^N×2^N$ の画像を$D_N$ とします。
- the pixel with coordinates $x = 0$, $y = 0$ corresponds to the bottom left pixel,
- if ${(x - 2^{N - 1})}^2 + {(y - 2^{N - 1})}^2 2^{2N - 2}$ then the pixel is black,
- otherwise the pixel is white.
- 座標 $x = 0$, $y = 0$ のピクセルは左下のピクセルに対応します。
- ${(x - 2^{N - 1})}^2 + {(y - 2 ^{N - 1})}^2 = 2^{2N - 2}$ の場合、ピクセルは黒です。
- それ以外の場合、ピクセルは白です。
What is the length of the minimal sequence describing $D_{24}$?
$D_{24} $ を表す最小の数列の長さを求めなさい。
# --hints--
`quadtreeEncoding()` should return `313135496`.
`quadtreeEncoding()` `313135496` を返す必要があります。
```js
assert.strictEqual(quadtreeEncoding(), 313135496);

View File

@ -1,6 +1,6 @@
---
id: 5900f48d1000cf542c50ff9f
title: 'Problem 288: An enormous factorial'
title: '問題 288: 巨大な階乗'
challengeType: 5
forumTopicId: 301939
dashedName: problem-288-an-enormous-factorial
@ -8,21 +8,21 @@ dashedName: problem-288-an-enormous-factorial
# --description--
For any prime $p$ the number $N(p,q)$ is defined by $N(p,q) = \sum_{n=0}^q T_n \times p^n$ with $T_n$ generated by the following random number generator:
任意の素数 $p$ に対し、数 $N(p,q)$ は $N(p,q) = \sum_{n=0}^q T_n \times p^n$ と定義されます。$T_n$ は下の乱数生成法で生成されます。
$$\begin{align} & S_0 = 290797 \\\\ & S_{n + 1} = {S_n}^2\bmod 50\\,515\\,093 \\\\ & T_n = S_n\bmod p \end{align}$$
Let $Nfac(p,q)$ be the factorial of $N(p,q)$.
$Nfac(p,q)$ を、$N(p,q)$ の階乗と定義します。
Let $NF(p,q)$ be the number of factors $p$ in $Nfac(p,q)$.
$NF(p,q)$ を、$Nfac(p,q)$ 内の因数 $p$ の数と定義します。
You are given that $NF(3,10000) \bmod 3^{20} = 624\\,955\\,285$.
$NF(3,10000) \bmod 3^{20} = 624\\,955\\,285$ が与えられます。
Find $NF(61,{10}^7)\bmod {61}^{10}$.
$NF(61,{10}^7)\bmod {61}^{10}$ を求めなさい。
# --hints--
`enormousFactorial()` should return `605857431263982000`.
`enormousFactorial()` `605857431263982000` を返す必要があります。
```js
assert.strictEqual(enormousFactorial(), 605857431263982000);

View File

@ -1,6 +1,6 @@
---
id: 5900f48d1000cf542c50ffa0
title: 'Problem 289: Eulerian Cycles'
title: '問題 289: オイラー閉路'
challengeType: 5
forumTopicId: 301940
dashedName: problem-289-eulerian-cycles
@ -8,23 +8,23 @@ dashedName: problem-289-eulerian-cycles
# --description--
Let $C(x,y)$ be a circle passing through the points ($x$, $y$), ($x$, $y + 1$), ($x + 1$, $y$) and ($x + 1$, $y + 1$).
($x$, $y$), ($x$, $y + 1$), ($x + 1$, $y$), ($x + 1$, $y + 1$) を通過する円を $C(x,y)$ とします。
For positive integers $m$ and $n$, let $E(m,n)$ be a configuration which consists of the $m·n$ circles: { $C(x,y)$: $0 ≤ x &lt; m$, $0 ≤ y &lt; n$, $x$ and $y$ are integers }
正の整数 $m$, $n$ に対し、$m·n$ の円 { $C(x,y)$: $0 ≤ x &lt; m$, $0 ≤ y &lt; n$, $x$ $y$ は整数 } からなる図形を $E (m,n) とします。
An Eulerian cycle on $E(m,n)$ is a closed path that passes through each arc exactly once. Many such paths are possible on $E(m,n)$, but we are only interested in those which are not self-crossing: A non-crossing path just touches itself at lattice points, but it never crosses itself.
$E(m,n)$ 上のオイラー閉路は、各弧をちょうど 1 回ずつ通る閉路です。 $E(m,n)$ 上にはそのような経路が数多くありますが、ここではそれ自体と交差しないもののみに注目します。交差しない経路とは、格子点でそれ自体に触れるだけであり、それ自体と決して交わらない経路です。
The image below shows $E(3,3)$ and an example of an Eulerian non-crossing path.
下の画像は、$E(3,3)$ と、交差しないオイラー経路の例です。
<img class="img-responsive center-block" alt="Eulerian cycle E(3, 3) and Eulerian non-crossing path" src="https://cdn.freecodecamp.org/curriculum/project-euler/eulerian-cycles.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="オイラー閉路 E(3,3) と、交差しないオイラー経路" src="https://cdn.freecodecamp.org/curriculum/project-euler/eulerian-cycles.gif" style="background-color: white; padding: 10px;" />
Let $L(m,n)$ be the number of Eulerian non-crossing paths on $E(m,n)$. For example, $L(1,2) = 2$, $L(2,2) = 37$ and $L(3,3) = 104290$.
$E(m,n)$ 上の交差しないオイラー経路の数を $L(m,n)$ とします。 例えば、$L(1,2) = 2$, $L(2,2) = 37$, $L(3,3) = 104290$ です。
Find $L(6,10)\bmod {10}^{10}$.
$L(6,10)\bmod {10}^{10}$ を求めなさい。
# --hints--
`eulerianCycles()` should return `6567944538`.
`eulerianCycles()` `6567944538` を返す必要があります。
```js
assert.strictEqual(eulerianCycles(), 6567944538);

View File

@ -1,6 +1,6 @@
---
id: 5900f48f1000cf542c50ffa1
title: 'Problem 290: Digital Signature'
title: '問題 290: 数字の性質'
challengeType: 5
forumTopicId: 301942
dashedName: problem-290-digital-signature
@ -8,11 +8,11 @@ dashedName: problem-290-digital-signature
# --description--
How many integers $0 ≤ n &lt; {10}^{18}$ have the property that the sum of the digits of $n$ equals the sum of digits of $137n$?
$0 ≤ n &lt; {10}^{18}$ のとき、$n$ の各位の和が $137n$ の各位の和と等しくなるという性質を持つ整数 $n$ はいくつありますか。
# --hints--
`digitalSignature()` should return `20444710234716470`.
`digitalSignature()` `20444710234716470` を返す必要があります。
```js
assert.strictEqual(digitalSignature(), 20444710234716470);

View File

@ -1,6 +1,6 @@
---
id: 5900f48f1000cf542c50ffa2
title: 'Problem 291: Panaitopol Primes'
title: '問題 291: Panaitopol 素数'
challengeType: 5
forumTopicId: 301943
dashedName: problem-291-panaitopol-primes
@ -8,13 +8,13 @@ dashedName: problem-291-panaitopol-primes
# --description--
A prime number $p$ is called a Panaitopol prime if $p = \frac{x^4 - y^4}{x^3 + y^3}$ for some positive integers $x$ and $y$.
正の整数 $x$ と $y$ に対して素数 $p = \frac{x^4 - y^4}{x^3 + y^3}$ が成り立つとき、$p$ は Panaitopol 素数と呼ばれます。
Find how many Panaitopol primes are less than $5 × {10}^{15}$.
$5 × {10}^{15}$ 未満の Panaitopol 素数はいくつありますか。
# --hints--
`panaitopolPrimes()` should return `4037526`.
`panaitopolPrimes()` `4037526` を返す必要があります。
```js
assert.strictEqual(panaitopolPrimes(), 4037526);

View File

@ -1,6 +1,6 @@
---
id: 5900f4911000cf542c50ffa3
title: 'Problem 292: Pythagorean Polygons'
title: '問題 292: ピタゴラス多角形'
challengeType: 5
forumTopicId: 301944
dashedName: problem-292-pythagorean-polygons
@ -8,24 +8,24 @@ dashedName: problem-292-pythagorean-polygons
# --description--
We shall define a pythagorean polygon to be a convex polygon with the following properties:
次の性質をすべて備える凸多角形を「ピタゴラス多角形」と定義します。
- there are at least three vertices,
- no three vertices are aligned,
- each vertex has integer coordinates,
- each edge has integer length.
- 少なくとも 3 つの頂点がある。
- どの 3 頂点も一直線上に並んでいない。
- 各頂点の座標が整数である。
- 各辺の長さが整数である。
For a given integer $n$, define $P(n)$ as the number of distinct pythagorean polygons for which the perimeter is $≤ n$.
与えられた整数 $n$ について、周長が $n$ 以下の相異なるピタゴラス多角形の個数を $P(n)$ とします。
Pythagorean polygons should be considered distinct as long as none is a translation of another.
ピタゴラス多角形は、平行移動で同一にならない限り相異なるものとみなされます。
You are given that $P(4) = 1$, $P(30) = 3655$ and $P(60) = 891045$.
$P(4) = 1$, $P(30) = 3655$, $P(60) = 891045$ が与えられます。
Find $P(120)$.
$P(120)$ を求めなさい。
# --hints--
`pythagoreanPolygons()` should return `3600060866`.
`pythagoreanPolygons()` `3600060866` を返す必要があります。
```js
assert.strictEqual(pythagoreanPolygons(), 3600060866);

View File

@ -1,6 +1,6 @@
---
id: 5900f4931000cf542c50ffa4
title: 'Problem 293: Pseudo-Fortunate Numbers'
title: '問題 293: 疑似フォーチュン数'
challengeType: 5
forumTopicId: 301945
dashedName: problem-293-pseudo-fortunate-numbers
@ -8,19 +8,19 @@ dashedName: problem-293-pseudo-fortunate-numbers
# --description--
An even positive integer $N$ will be called admissible, if it is a power of 2 or its distinct prime factors are consecutive primes.
偶数の正整数 $N$ は、2 の累乗であるか、またはその相異なる素因数が連続した素数である場合、「許容的」であるとされます。
The first twelve admissible numbers are 2, 4, 6, 8, 12, 16, 18, 24, 30, 32, 36, 48.
許容的な数を最小のものから 12 個挙げると 2, 4, 6, 8, 12, 16, 18, 24, 30, 32, 36, 48 となります。
If $N$ is admissible, the smallest integer $M > 1$ such that $N + M$ is prime, will be called the pseudo-Fortunate number for $N$.
$N$ が許容的である場合、$N + M$ が素数になるような最小の整数 $M > 1$ を、$N$ に対する「擬似フォーチュン数」と呼ぶことにします。
For example, $N = 630$ is admissible since it is even and its distinct prime factors are the consecutive primes 2, 3, 5 and 7. The next prime number after 631 is 641; hence, the pseudo-Fortunate number for 630 is $M = 11$. It can also be seen that the pseudo-Fortunate number for 16 is 3.
例えば、$N = 630$ は許容的です。偶数であり、その相異なる素因子は連続する素数 2, 3, 5, 7 だからです。 631 の次の 素数は 641 なので、630 に対する疑似フォーチュン数は $M = 11$ です。 また、16 の擬似フォーチュン数が 3 であることが分かります。
Find the sum of all distinct pseudo-Fortunate numbers for admissible numbers $N$ less than ${10}^9$.
${10}^9$ 未満の許容的な数 $N$ に対する相異なる疑似フォーチュン数の総和を求めなさい。
# --hints--
`pseudoFortunateNumbers()` should return `2209`.
`pseudoFortunateNumbers()` `2209` を返す必要があります。
```js
assert.strictEqual(pseudoFortunateNumbers(), 2209);

View File

@ -1,6 +1,6 @@
---
id: 5900f4931000cf542c50ffa5
title: 'Problem 294: Sum of digits - experience #23'
title: '問題 294: 各位の和 - 23 に注目'
challengeType: 5
forumTopicId: 301946
dashedName: problem-294-sum-of-digits---experience-23
@ -8,20 +8,20 @@ dashedName: problem-294-sum-of-digits---experience-23
# --description--
For a positive integer $k$, define $d(k)$ as the sum of the digits of $k$ in its usual decimal representation. Thus $d(42) = 4 + 2 = 6$.
正の整数 $k$ について、通常の 10 進数で表された $k$ の各位の和を $d(k)$ とします。 したがって、$d(42) = 4 + 2 = 6$ です。
For a positive integer $n$, define $S(n)$ as the number of positive integers $k &lt; {10}^n$ with the following properties:
正の整数 $n$ について、次の性質を持つ整数 $k &lt; {10}^n$ の個数を $S(n)$ とします。
- $k$ is divisible by 23 and,
- $d(k) = 23$.
- $k$ が 23 で割り切れる。かつ、
- $d(k) = 23$ である。
You are given that $S(9) = 263\\,626$ and $S(42) = 6\\,377\\,168\\,878\\,570\\,056$.
$S(9) = 263\\,626$, $S(42) = 6\\,377\\,168\\,878\\,570\\,056$ が与えられます。
Find $S({11}^{12})$ and give your answer $\bmod {10}^9$.
$S({11}^{12})$ を求め、$\bmod {10}^9$ で答えなさい。
# --hints--
`experience23()` should return `789184709`.
`experience23()` `789184709` を返す必要があります。
```js
assert.strictEqual(experience23(), 789184709);

View File

@ -1,6 +1,6 @@
---
id: 5900f4931000cf542c50ffa6
title: 'Problem 295: Lenticular holes'
title: '問題 295: レンズ状の穴'
challengeType: 5
forumTopicId: 301947
dashedName: problem-295-lenticular-holes
@ -8,31 +8,31 @@ dashedName: problem-295-lenticular-holes
# --description--
We call the convex area enclosed by two circles a lenticular hole if:
2 つの円に囲まれた凸状の領域が次の条件を満たす場合、その領域を「レンズ状の穴」と呼びます。
- The centres of both circles are on lattice points.
- The two circles intersect at two distinct lattice points.
- The interior of the convex area enclosed by both circles does not contain any lattice points.
- 両方の円心が格子点上にある。
- 2 つの円が 2 つの相異なる格子点で交差する
- 両方の円に囲まれた凸状の領域が格子点を内包しない。
Consider the circles:
次のような円を考えます。
$$\begin{align} & C_0: x^2 + y^2 = 25 \\\\ & C_1: {(x + 4)}^2 + {(y - 4)}^2 = 1 \\\\ & C_2: {(x - 12)}^2 + {(y - 4)}^2 = 65 \end{align}$$
The circles $C_0$, $C_1$ and $C_2$ are drawn in the picture below.
$C_0$, $C_1$, $C_2$ を下図に示します。
<img class="img-responsive center-block" alt="C_0, C_1 and C_2 circles" src="https://cdn.freecodecamp.org/curriculum/project-euler/lenticular-holes.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="C_0, C_1, C_2" src="https://cdn.freecodecamp.org/curriculum/project-euler/lenticular-holes.gif" style="background-color: white; padding: 10px;" />
$C_0$ and $C_1$ form a lenticular hole, as well as $C_0$ and $C_2$.
$C_0$ $C_1$ はレンズ状の穴を形成し、$C_0$ $C_2$ も同様です。
We call an ordered pair of positive real numbers ($r_1$, $r_2$) a lenticular pair if there exist two circles with radii $r_1$ and $r_2$ that form a lenticular hole. We can verify that ($1$, $5$) and ($5$, $\sqrt{65}$) are the lenticular pairs of the example above.
レンズ状の穴を形成する半径 $r_1$, $r_2$ の 2 つの円が存在する場合、正の実数の順序対 ($r_1$, $r_2$) を「レンズペア」と呼びます。 上の例では、($1$, $5$) ($5$, $\sqrt{65}$) が共にレンズペアであることを確認できます。
Let $L(N)$ be the number of distinct lenticular pairs ($r_1$, $r_2$) for which $0 &lt; r_1 ≤ r_2 ≤ N$. We can verify that $L(10) = 30$ and $L(100) = 3442$.
$0 &lt; r_1 ≤ r_2 ≤ N$ となるような相異なるレンズペア ($r_1$, $r_2$) の個数を $L(N)$ とします。 $L(10) = 30$, $L(100) = 3442$ であることを確認できます。
Find $L(100\\,000)$.
$L(100\\,000)$ を求めなさい。
# --hints--
`lenticularHoles()` should return `4884650818`.
`lenticularHoles()` `4884650818` を返す必要があります。
```js
assert.strictEqual(lenticularHoles(), 4884650818);

View File

@ -1,6 +1,6 @@
---
id: 5900f4941000cf542c50ffa7
title: 'Problem 296: Angular Bisector and Tangent'
title: '問題 296: 角の二等分線と接線'
challengeType: 5
forumTopicId: 301948
dashedName: problem-296-angular-bisector-and-tangent
@ -8,17 +8,17 @@ dashedName: problem-296-angular-bisector-and-tangent
# --description--
Given is an integer sided triangle $ABC$ with $BC ≤ AC ≤ AB$. $k$ is the angular bisector of angle $ACB$. $m$ is the tangent at $C$ to the circumscribed circle of $ABC$. $n$ is a line parallel to $m$ through $B$.
辺の長さが整数である三角形 $ABC$ ($BC ≤ AC ≤ AB$) が与えられます。 $k$ は角 $ACB$ の二等分線です。 $m$ は、$ABC$ の外接円の $C$ における接線です。 $n$は、$B$ を通り $m$ に平行な線です。
The intersection of $n$ and $k$ is called $E$.
$n$ $k$ の交点を $E$ とします。
<img class="img-responsive center-block" alt="triangle ABC, with k - the angular bisector of angle ACB, m - tangent at point C, n - line parallel to m through B, and point E - intersection of k and n" src="https://cdn.freecodecamp.org/curriculum/project-euler/angular-bisector-and-tangent.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="三角形 ABC において、k は角 ACB の二等分線、m は点 C での接線、n は B を通り m に平行な線、点 E は k と n の交点を示す" src="https://cdn.freecodecamp.org/curriculum/project-euler/angular-bisector-and-tangent.gif" style="background-color: white; padding: 10px;" />
How many triangles $ABC$ with a perimeter not exceeding $100\\,000$ exist such that $BE$ has integral length?
$BE$ の長さが整数であり周長が $100\\,000$ を超えない三角形 $ABC$ はいくつありますか。
# --hints--
`angularBisectorAndTangent()` should return `1137208419`.
`angularBisectorAndTangent()` `1137208419` を返す必要があります。
```js
assert.strictEqual(angularBisectorAndTangent(), 1137208419);

View File

@ -1,6 +1,6 @@
---
id: 5900f4951000cf542c50ffa8
title: 'Problem 297: Zeckendorf Representation'
title: '問題 297: ゼッケンドルフ表現'
challengeType: 5
forumTopicId: 301949
dashedName: problem-297-zeckendorf-representation
@ -8,25 +8,25 @@ dashedName: problem-297-zeckendorf-representation
# --description--
Each new term in the Fibonacci sequence is generated by adding the previous two terms.
フィボナッチ数列の新しい項はそれぞれ、前の 2 項を足すことによって得られます。
Starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89.
1 と 2 から始まる最初の 10 項は 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 です。
Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, 100 = 3 + 8 + 89.
すべての正の整数は、フィボナッチ数列の非連続項の和として一意に表すことができます。 例えば、100 = 3 + 8 + 89です。
Such a sum is called the Zeckendorf representation of the number.
このような和は、数のゼッケンドルフ表現と呼ばれます。
For any integer $n>0$, let $z(n)$ be the number of terms in the Zeckendorf representation of $n$.
任意の整数 $n>0$ について、$n$ のゼッケンドルフ表現における項数を $z(n)$ とします。
Thus, $z(5) = 1$, $z(14) = 2$, $z(100) = 3$ etc.
すなわち、$z(5) = 1$, $z(14) = 2$, $z(100) = 3$ などです。
Also, for $0 &lt; n &lt; {10}^6$, $\sum z(n) = 7\\,894\\,453$.
また、$0 &lt; &lt; {10}^6$ のとき、$\sum z(n) = 7\\,894\\,453$ です。
Find $\sum z(n)$ for $0 &lt; n &lt; {10}^{17}$.
$0 &lt; n &lt; {10}^{17}$ のとき、$\sum z(n)$ を求めなさい。
# --hints--
`zeckendorfRepresentation()` should return `2252639041804718000`.
`zeckendorfRepresentation()` `2252639041804718000` を返す必要があります。
```js
assert.strictEqual(zeckendorfRepresentation(), 2252639041804718000);

View File

@ -1,6 +1,6 @@
---
id: 5900f4971000cf542c50ffa9
title: 'Problem 298: Selective Amnesia'
title: '問題 298: 選択的健忘'
challengeType: 5
forumTopicId: 301950
dashedName: problem-298-selective-amnesia
@ -8,30 +8,30 @@ dashedName: problem-298-selective-amnesia
# --description--
Larry and Robin play a memory game involving of a sequence of random numbers between 1 and 10, inclusive, that are called out one at a time. Each player can remember up to 5 previous numbers. When the called number is in a player's memory, that player is awarded a point. If it's not, the player adds the called number to his memory, removing another number if his memory is full.
ラリーとロビンが記憶ゲームをします。1 から 10 のうち無作為に選ばれた数が一度に 1 つずつ呼び出されます。 各プレイヤーは、以前の数を最大 5 つ記憶できます。 呼び出された数がプレイヤーの記憶にあれば、1 点が与えられます。 記憶になければ、プレイヤーは呼び出された数を自分の記憶に加え、もし記憶が一杯であれば他の数を 1 つ記憶から消します。
Both players start with empty memories. Both players always add new missed numbers to their memory but use a different strategy in deciding which number to remove: Larry's strategy is to remove the number that hasn't been called in the longest time. Robin's strategy is to remove the number that's been in the memory the longest time.
開始時、2 人のプレイヤーの記憶は空です。 両プレイヤーは、記憶になかった新しい数を必ず記憶に加えますが、どの数を消すかを決めるための戦略が異なります。ラリーの戦略は、最も長い間呼び出されなかった数を消すことです。 ロビンの戦略は、最も長く記憶にとどまっていた数を消すことです。
Example game:
ゲームの例:
| Turn | Called number | Larry's memory | Larry's score | Robin's memory | Robin's score |
| ---- | ------------- | --------------:| ------------- | -------------- | ------------- |
| 1 | 1 | 1 | 0 | 1 | 0 |
| 2 | 2 | 1,2 | 0 | 1,2 | 0 |
| 3 | 4 | 1,2,4 | 0 | 1,2,4 | 0 |
| 4 | 6 | 1,2,4,6 | 0 | 1,2,4,6 | 0 |
| 5 | 1 | 1,2,4,6 | 1 | 1,2,4,6 | 1 |
| 6 | 8 | 1,2,4,6,8 | 1 | 1,2,4,6,8 | 1 |
| 7 | 10 | 1,4,6,8,10 | 1 | 2,4,6,8,10 | 1 |
| 8 | 2 | 1,2,6,8,10 | 1 | 2,4,6,8,10 | 2 |
| 9 | 4 | 1,2,4,8,10 | 1 | 2,4,6,8,10 | 3 |
| 10 | 1 | 1,2,4,8,10 | 2 | 1,4,6,8,10 | 3 |
| ターン | 呼び出された番号 | ラリーの記憶 | ラリーのスコア | ロビンの記憶 | ロビンのスコア |
| --- | -------- | ----------:| ------- | ---------- | ------- |
| 1 | 1 | 1 | 0 | 1 | 0 |
| 2 | 2 | 1,2 | 0 | 1,2 | 0 |
| 3 | 4 | 1,2,4 | 0 | 1,2,4 | 0 |
| 4 | 6 | 1,2,4,6 | 0 | 1,2,4,6 | 0 |
| 5 | 1 | 1,2,4,6 | 1 | 1,2,4,6 | 1 |
| 6 | 8 | 1,2,4,6,8 | 1 | 1,2,4,6,8 | 1 |
| 7 | 10 | 1,4,6,8,10 | 1 | 2,4,6,8,10 | 1 |
| 8 | 2 | 1,2,6,8,10 | 1 | 2,4,6,8,10 | 2 |
| 9 | 4 | 1,2,4,8,10 | 1 | 2,4,6,8,10 | 3 |
| 10 | 1 | 1,2,4,8,10 | 2 | 1,4,6,8,10 | 3 |
Denoting Larry's score by $L$ and Robin's score by $R$, what is the expected value of $|L - R|$ after 50 turns? Give your answer rounded to eight decimal places using the format x.xxxxxxxx .
ラリーのスコアを $L$、ロビンのスコアを $R$ で表すものとし、50 ターン後の $|L-R|$ の期待値を求めなさい。 回答は、四捨五入して小数第 8 位まで求め、x.xxxxxxxx の形式にすること。
# --hints--
`selectiveAmnesia()` should return `1.76882294`.
`selectiveAmnesia()` `1.76882294` を返す必要があります。
```js
assert.strictEqual(selectiveAmnesia(), 1.76882294);

View File

@ -1,6 +1,6 @@
---
id: 5900f4971000cf542c50ffaa
title: 'Problem 299: Three similar triangles'
title: '問題 299: 3 つの相似三角形'
challengeType: 5
forumTopicId: 301951
dashedName: problem-299-three-similar-triangles
@ -8,29 +8,29 @@ dashedName: problem-299-three-similar-triangles
# --description--
Four points with integer coordinates are selected:
整数座標を持つ、次の 4 つの点が選択されます。
$A(a, 0)$, $B(b, 0)$, $C(0, c)$ and $D(0, d)$, with $0 &lt; a &lt; b$ and $0 &lt; c &lt; d$.
$A(a, 0)$, $B(b, 0)$, $C(0, c)$, $D(0, d)$ ($0 &lt; a &lt; b$ かつ $0 &lt; c &lt; d$)
Point $P$, also with integer coordinates, is chosen on the line $AC$ so that the three triangles $ABP$, $CDP$ and $BDP$ are all similar.
3 つの三角形 $ABP$, $CDP$, $BDP$ がすべて相似形になるように、同じく整数座標を持つ点 $P$ を線 $AC$ 上で選びます。
<img class="img-responsive center-block" alt="points A, B, C, D and P creating three triangles: ABP, CDP, and BDP" src="https://cdn.freecodecamp.org/curriculum/project-euler/three-similar-triangles.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt=" A, B, C, D, P で作られる 3 つの三角形 ABP, CDP, BDP" src="https://cdn.freecodecamp.org/curriculum/project-euler/three-similar-triangles.gif" style="background-color: white; padding: 10px;" />
It is easy to prove that the three triangles can be similar, only if $a = c$.
$a = c$ のときのみ 3 つの三角形が相似形になり得るということは、容易に証明できます。
So, given that $a = c$, we are looking for triplets ($a$, $b$, $d$) such that at least one point $P$ (with integer coordinates) exists on $AC$, making the three triangles $ABP$, $CDP$ and $BDP$ all similar.
つまり、$a=c$ とすると、(整数座標を持つ) 点 $P$ が $AC$ 上に少なくとも 1 つ存在して 3 つの三角形 $ABP$, $CDP$, $BDP$ がすべて相似形になるような、三つ組数 ($a$, $b$, $d$) を探します。
For example, if $(a, b, d) = (2, 3, 4)$, it can be easily verified that point $P(1, 1)$ satisfies the above condition. Note that the triplets (2,3,4) and (2,4,3) are considered as distinct, although point $P(1, 1)$ is common for both.
例えば、$(a, b, d) = (2, 3, 4)$ の場合、点 $P(1, 1)$ が上の条件を満たすことを容易に確認できます。 注意点として、三つ組数 (2,3,4) (2,4,3) は点 $P(1, 1)$ を共有しますが相異なる組とみなされます。
If $b + d &lt; 100$, there are 92 distinct triplets ($a$, $b$, $d$) such that point $P$ exists.
$b + d &lt; 100$ の場合、点 $P$ が存在するような相異なる三つ組数 ($a$, $b$, $d$) は 92 個存在します。
If $b + d &lt; 100\\,000$, there are 320471 distinct triplets ($a$, $b$, $d$) such that point $P$ exists.
$b + d &lt; 100\\,000$ の場合、点 $P$ が存在するような相異なる三つ組数 ($a$, $b$, $d$) は 320471 個存在します。
If $b + d &lt; 100\\,000\\,000$, how many distinct triplets ($a$, $b$, $d$) are there such that point $P$ exists?
$b + d &lt; 100\\,000\\,000$ の場合、点 $P$ が存在するような相異なる三つ組数 ($a$, $b$, $d$) はいくつ存在しますか。
# --hints--
`threeSimilarTriangles()` should return `549936643`.
`threeSimilarTriangles()` `549936643` を返す必要があります。
```js
assert.strictEqual(threeSimilarTriangles(), 549936643);

View File

@ -1,6 +1,6 @@
---
id: 5900f49a1000cf542c50ffac
title: 'Problem 300: Protein folding'
title: '問題 300: タンパク質の折り畳み'
challengeType: 5
forumTopicId: 301954
dashedName: problem-300-protein-folding
@ -8,29 +8,29 @@ dashedName: problem-300-protein-folding
# --description--
In a very simplified form, we can consider proteins as strings consisting of hydrophobic (H) and polar (P) elements, e.g. HHPPHHHPHHPH.
非常に単純化すれば、タンパク質は疎水性要素 (H) と極性要素 (P) で構成される文字列と考えることができます。例えば、HHPPHHHPHHPH です。
For this problem, the orientation of a protein is important; e.g. HPP is considered distinct from PPH. Thus, there are $2^n$ distinct proteins consisting of $n$ elements.
この問題ではタンパク質の方向が重要であり、例えば HPP は PPH と区別されます。 したがって、$n$ 個の要素で構成される相異なるタンパク質は $2^n$ 種類存在します。
When one encounters these strings in nature, they are always folded in such a way that the number of H-H contact points is as large as possible, since this is energetically advantageous.
自然界では、これらの文字列は常に H-H 接点の数ができるだけ多くなるように折り畳まれています。その方がエネルギー面で有利だからです。
As a result, the H-elements tend to accumulate in the inner part, with the P-elements on the outside.
その結果、H 要素は内側に蓄積し、P 要素は外側に蓄積する傾向があります。
Natural proteins are folded in three dimensions of course, but we will only consider protein folding in <u>two dimensions</u>.
自然のタンパク質はもちろん三次元で折り畳まれていますが、ここでは<u>二次元</u>で折り畳まれるタンパク質のみを考えます。
The figure below shows two possible ways that our example protein could be folded (H-H contact points are shown with red dots).
下図は、上の例のタンパク質を折り畳む 2 通りの方法を示しています (赤い点は H-H 接点)。
<img class="img-responsive center-block" alt="two possible ways to fold example protein" src="https://cdn.freecodecamp.org/curriculum/project-euler/protein-folding.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="タンパク質 (例) を折り畳む 2 通りの方法" src="https://cdn.freecodecamp.org/curriculum/project-euler/protein-folding.gif" style="background-color: white; padding: 10px;" />
The folding on the left has only six H-H contact points, thus it would never occur naturally. On the other hand, the folding on the right has nine H-H contact points, which is optimal for this string.
左側の折り畳みは H-H 接点が 6つしかないため、自然にこの形になることはあり得ないでしょう。 一方、右側の折り畳みは H-H 接点が 9 つあり、この文字列には最適です。
Assuming that H and P elements are equally likely to occur in any position along the string, the average number of H-H contact points in an optimal folding of a random protein string of length 8 turns out to be $\frac{850}{2^8} = 3.3203125$.
文字列のいずれの位置にも H 要素と P 要素が同じ確率で存在すると仮定すると、長さ 8 の無作為なタンパク質文字列の最適な折り畳みにおいて、H-H 接点の平均数は $\frac{850}{2^8} = 3.3203125$ になります。
What is the average number of H-H contact points in an optimal folding of a random protein string of length 15? Give your answer using as many decimal places as necessary for an exact result.
長さ 15 の無作為なタンパク質文字列の最適な折り畳みにおいて、H-H 接点の平均数はいくつですか。 回答は、厳密な結果に対して適宜小数位を使用すること。
# --hints--
`proteinFolding()` should return `8.0540771484375`.
`proteinFolding()` `8.0540771484375` を返す必要があります。
```js
assert.strictEqual(proteinFolding(), 8.0540771484375);

View File

@ -1,6 +1,6 @@
---
id: 5900f4991000cf542c50ffab
title: 'Problem 301: Nim'
title: '問題 301: ニム (石取りゲーム)'
challengeType: 5
forumTopicId: 301955
dashedName: problem-301-nim
@ -8,31 +8,31 @@ dashedName: problem-301-nim
# --description--
Nim is a game played with heaps of stones, where two players take it in turn to remove any number of stones from any heap until no stones remain.
ニムは石が積まれた山で遊ぶゲームです。2 人のプレイヤーが交互に任意の山から任意の数の石を取り、石がなくなったら終了です。
We'll consider the three-heap normal-play version of Nim, which works as follows:
ここでは、3 つの山を使う一般的なニムの遊び方を考えます。ルールは次のとおりです。
- At the start of the game there are three heaps of stones.
- On his turn the player removes any positive number of stones from any single heap.
- The first player unable to move (because no stones remain) loses.
- 開始時、石の山が 3 つあります。
- プレイヤーは自分のターンで、任意の 1 つの山から任意の正の整数個の石を取ります。
- 先に (もう石がないために) 石を取れなくなったプレイヤーの負けです。
If ($n_1$, $n_2$, $n_3$) indicates a Nim position consisting of heaps of size $n_1$, $n_2$ and $n_3$ then there is a simple function $X(n_1,n_2,n_3)$ — that you may look up or attempt to deduce for yourself — that returns:
サイズ $n_1$, $n_2$, $n_3$ の山がある場合のニムのポジションを ($n_1$, $n_2$, $n_3$) で表すとします。次の結果を返す単純な関数 $X(n_1,n_2,n_3)$ があります (この関数については自ら調べるか導出すること)。
- zero if, with perfect strategy, the player about to move will eventually lose; or
- non-zero if, with perfect strategy, the player about to move will eventually win.
- 0: 完璧な戦略に基づけば、現在のプレイヤー(今、自分の番を迎えている人) が最終的に負ける。
- 0 以外: 完璧な戦略に基づけば、現在のプレイヤー(今、自分の番を迎えている人) が最終的に勝つ。
For example $X(1, 2, 3) = 0$ because, no matter what the current player does, his opponent can respond with a move that leaves two heaps of equal size, at which point every move by the current player can be mirrored by his opponent until no stones remain; so the current player loses. To illustrate:
例えば、$X(1, 2, 3) = 0$ です。なぜなら現在のプレイヤーが何をしても、対戦相手は同じサイズの山を 2 つ残すように石を取れるからです。その時点で、以降に現在のプレイヤーがどのように石を取っても対戦相手が同じように取れることが確定し、現在のプレーヤーは負けます。 下に具体例を示します。
- current player moves to (1,2,1)
- opponent moves to (1,0,1)
- current player moves to (0,0,1)
- opponent moves to (0,0,0), and so wins.
- 現在のプレイヤーがポジションを (1,2,1) にする
- 対戦相手がポジションを (1,0,1) にする
- 現在のプレイヤーがポジションを (0,0,1) にする
- 対戦相手がポジションを (0,0,0) にし、勝つ。
For how many positive integers $n ≤ 2^{30}$ does $X(n, 2n, 3n) = 0$?
$X(n, 2n, 3n) = 0$ となる正の整数 $n ≤ 2^{30}$ はいくつありますか。
# --hints--
`nim()` should return `2178309`.
`nim()` `2178309` を返す必要があります。
```js
assert.strictEqual(nim(), 2178309);

View File

@ -1,6 +1,6 @@
---
id: 5900f49b1000cf542c50ffad
title: 'Problem 302: Strong Achilles Numbers'
title: '問題 302: 強力なアキレス数'
challengeType: 5
forumTopicId: 301956
dashedName: problem-302-strong-achilles-numbers
@ -8,23 +8,23 @@ dashedName: problem-302-strong-achilles-numbers
# --description--
A positive integer $n$ is powerful if $p^2$ is a divisor of $n$ for every prime factor $p$ in $n$.
正の整数 $n$ のすべての素因数 $p$ について $p^2$ が $n$ の約数である場合、$n$ は多冪数です。
A positive integer $n$ is a perfect power if $n$ can be expressed as a power of another positive integer.
正の整数 $n$ を別の正の整数の累乗で表せる場合、$n$ は累乗数です。
A positive integer $n$ is an Achilles number if $n$ is powerful but not a perfect power. For example, 864 and 1800 are Achilles numbers: $864 = 2^5 \times 3^3$ and $1800 = 2^3 \times 3^2 \times 5^2$.
正の整数 $n$ が多冪数であるが累乗数ではない場合、$n$ はアキレス数です。 例えば、864 1800 はアキレス数です。それぞれ、$864 = 2^5 \times 3^3$ $1800 = 2^3 \times 3^2 \times 5^2$ です。
We shall call a positive integer $S$ a Strong Achilles number if both $S$ and $φ(S)$ are Achilles numbers. $φ$ denotes Euler's totient function.
正の整数 $S$ と φ(S)$ の両方がアキレス数の場合、$S$ を「強力なアキレス数」と呼ぶことにします。 $φ$ はオイラーのトーティエント関数を表します。
For example, 864 is a Strong Achilles number: $φ(864) = 288 = 2^5 \times 3^2$. However, 1800 isn't a Strong Achilles number because: $φ(1800) = 480 = 2^5 \times 3^1 \times 5^1$.
例えば、864 は強力なアキレス数です。$φ(864) = 288 = 2^5 \times 3^2$ となるからです。 しかし、1800 は強力なアキレス数ではありません。$φ(1800) = 480 = 2^5 \times 3^1 \times 5^1$ となるからです。
There are 7 Strong Achilles numbers below ${10}^4$ and 656 below ${10}^8$.
強力なアキレス数は ${10}^4$ 未満に 7 つ、${10}^8$ 未満に 656 個あります。
How many Strong Achilles numbers are there below ${10}^{18}$?
${10}^{18}$ 未満の強力なアキレス数はいくつありますか。
# --hints--
`strongAchillesNumbers()` should return `1170060`.
`strongAchillesNumbers()` `1170060` を返す必要があります。
```js
assert.strictEqual(strongAchillesNumbers(), 1170060);

View File

@ -1,6 +1,6 @@
---
id: 5900f49b1000cf542c50ffae
title: 'Problem 303: Multiples with small digits'
title: '問題 303: 小さい数字からなる倍数'
challengeType: 5
forumTopicId: 301957
dashedName: problem-303-multiples-with-small-digits
@ -8,17 +8,17 @@ dashedName: problem-303-multiples-with-small-digits
# --description--
For a positive integer $n$, define $f(n)$ as the least positive multiple of $n$ that, written in base 10, uses only digits $≤ 2$.
正の整数 $n$ について、$n$ の最小の正の倍数であり 10 進数表記で 2 以下の数字のみを使用する数を、$f(n)$ とします。
Thus $f(2) = 2$, $f(3) = 12$, $f(7) = 21$, $f(42) = 210$, $f(89) = 1\\,121\\,222$.
したがって、$f(2) = 2$, $f(3) = 12$, $f(7) = 21$, $f(42) = 210$, $f(89) = 1\\,121\\,222$ です。
Also, $\displaystyle\sum_{n = 1}^{100} \frac{f(n)}{n} = 11\\,363\\,107$.
また、$\displaystyle\sum_{n = 1}^{100} \frac{f(n)}{n} = 11\\,363\\,107$ です。
Find $\displaystyle\sum_{n = 1}^{10\\,000} \frac{f(n)}{n}$.
$\displaystyle\sum_{n = 1}^{10\\000} \frac{f(n)}{n} $ を求めなさい。
# --hints--
`multiplesWithSmallDigits()` should return `1111981904675169`.
`multiplesWithSmallDigits()` `1111981904675169` を返す必要があります。
```js
assert.strictEqual(multiplesWithSmallDigits(), 1111981904675169);

View File

@ -1,6 +1,6 @@
---
id: 5900f49d1000cf542c50ffaf
title: 'Problem 304: Primonacci'
title: '問題 304: 素数フィボナッチ数列 (Primonacci)'
challengeType: 5
forumTopicId: 301958
dashedName: problem-304-primonacci
@ -8,19 +8,19 @@ dashedName: problem-304-primonacci
# --description--
For any positive integer $n$ the function $\text{next_prime}(n)$ returns the smallest prime $p$ such that $p > n$.
任意の正の整数 $n$ について、関数 $\text{next_prime}(n)$ は、$p > n$ を満たす最小の素数 $p$ を返します。
The sequence $a(n)$ is defined by: $a(1) = \text{next_prime}({10}^{14})$ and $a(n) = \text{next_prime}(a(n - 1))$ for $n > 1$.
数列 $a(n)$ は次のように定義されます: $n > 1$ のとき、$a(1) = \text{next_prime}({10}^{14})$, $a(n) = \text{next_prime}(a(n - 1))$
The fibonacci sequence $f(n)$ is defined by: $f(0) = 0$, $f(1) = 1$ and $f(n) = f(n - 1) + f(n - 2)$ for $n > 1$.
フィボナッチ数列 $f(n)$ は次のように定義されます: $n > 1$ のとき、$f(0) = 0$, $f(1) = 1$, $f(n) = f(n - 1) + f(n - 2)$
The sequence $b(n)$ is defined as $f(a(n))$.
数列 $b(n)$ は $f(a(n))$ と定義されます。
Find $\sum b(n)$ for $1≤n≤100\\,000$. Give your answer $\bmod 1\\,234\\,567\\,891\\,011$.
$1 ≤ n ≤ 100\\,000$ のとき、$\sum b(n)$ を求めなさい。 $\bmod 1\\,234\\,567\\,891\\,011$ で答えること。
# --hints--
`primonacci()` should return `283988410192`.
`primonacci()` `283988410192` を返す必要があります。
```js
assert.strictEqual(primonacci(), 283988410192);

View File

@ -1,6 +1,6 @@
---
id: 5900f49d1000cf542c50ffb0
title: 'Problem 305: Reflexive Position'
title: '問題 305: 再帰位置'
challengeType: 5
forumTopicId: 301959
dashedName: problem-305-reflexive-position
@ -8,19 +8,19 @@ dashedName: problem-305-reflexive-position
# --description--
Let's call $S$ the (infinite) string that is made by concatenating the consecutive positive integers (starting from 1) written down in base 10.
10 進数表記の (1から始まる) 連続する正の整数を連結した (無限の) 文字列を、$S$ とします。
Thus, $S = 1234567891011121314151617181920212223242\ldots$
したがって、$S = 1234567891011121314151617181920212223242\ldots$ です。
It's easy to see that any number will show up an infinite number of times in $S$.
一見して分かるとおり、$S$ にはどの数字も無限に現れます。
Let's call $f(n)$ the starting position of the $n^{\text{th}}$ occurrence of $n$ in $S$. For example, $f(1) = 1$, $f(5) = 81$, $f(12) = 271$ and $f(7780) = 111\\,111\\,365$.
$S$ 内で $n$ が $n$ 回目に現れた開始位置を、$f(n)$ と定義します。 例えば、$f(1) = 1$, $f(5) = 81$, $f(12) = 271$, $f(7780) = 111\\,111\\,365$ です。
Find $\sum f(3^k) for 1 ≤ k ≤ 13$.
$1 ≤ k ≤ 13$ のとき、$\sum f(3^k) を求めなさい。
# --hints--
`reflexivePosition()` should return `18174995535140`.
`reflexivePosition()` `18174995535140` を返す必要があります。
```js
assert.strictEqual(reflexivePosition(), 18174995535140);

View File

@ -1,6 +1,6 @@
---
id: 5900f49f1000cf542c50ffb1
title: 'Problem 306: Paper-strip Game'
title: '問題 306: 短冊ゲーム'
challengeType: 5
forumTopicId: 301960
dashedName: problem-306-paper-strip-game
@ -8,27 +8,27 @@ dashedName: problem-306-paper-strip-game
# --description--
The following game is a classic example of Combinatorial Game Theory:
次のゲームは、組み合わせゲーム理論の古典的な例です。
Two players start with a strip of $n$ white squares and they take alternate turns. On each turn, a player picks two contiguous white squares and paints them black. The first player who cannot make a move loses.
一列に並べた $n$ 個の白いマスが最初にあり、2 人のプレイヤーが交互にプレイしていきます。 それぞれのターンで、プレイヤーは連続する白いマスを 2 つ選び、それらを黒く塗ります。 先にどこも塗れなくなったプレイヤーの負けです。
- $n = 1$: No valid moves, so the first player loses automatically.
- $n = 2$: Only one valid move, after which the second player loses.
- $n = 3$: Two valid moves, but both leave a situation where the second player loses.
- $n = 4$: There are three valid moves for the first player; who is able to win the game by painting the two middle squares.
- $n = 5$: Four valid moves for the first player (shown below in red); but no matter what the player does, the second player (blue) wins.
- $n = 1$: 有効な塗り方がないため、先手が自動的に負けます。
- $n = 2$: 有効な塗り方は 1 通りのみです。その後、後手が負けます。
- $n = 3$: 有効な塗り方が 2 通りありますが、いずれでも後手が負けます。
- $n = 4$: 先手には 3 通りの有効な塗り方があります。中央の 2 マスを塗れば勝てます。
- $n = 5$: 先手には有効な塗り方が 4 通りありますが (下図の赤色)、いずれでも後手 (青) が勝ちます。
<img class="img-responsive center-block" alt="valid starting moves for strip with 5 squares" src="https://cdn.freecodecamp.org/curriculum/project-euler/paper-strip-game.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="5 マスの短冊において有効な最初の塗り方" src="https://cdn.freecodecamp.org/curriculum/project-euler/paper-strip-game.gif" style="background-color: white; padding: 10px;" />
So, for $1 ≤ n ≤ 5$, there are 3 values of $n$ for which the first player can force a win.
したがって、$1 ≤ n ≤ 5$ のとき、先手が必ず勝てるような $n$ の値は 3 つあります。
Similarly, for $1 ≤ n ≤ 50$, there are 40 values of $n$ for which the first player can force a win.
同様に、$1 ≤ n ≤ 50$ のとき、先手が必ず勝てるような $n$ の値は 40 個あります。
For $1 ≤ n ≤ 1\\,000\\,000$, how many values of $n$ are there for which the first player can force a win?
$1 ≤ n ≤ 1\\,000\\,000$ のとき、先手が必ず勝てるような $n$ の値はいつくありますか。
# --hints--
`paperStripGame()` should return `852938`.
`paperStripGame()` `852938` を返す必要があります。
```js
assert.strictEqual(paperStripGame(), 852938);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a01000cf542c50ffb2
title: 'Problem 307: Chip Defects'
title: '問題 307: IC チップの不良'
challengeType: 5
forumTopicId: 301961
dashedName: problem-307-chip-defects
@ -8,15 +8,15 @@ dashedName: problem-307-chip-defects
# --description--
$k$ defects are randomly distributed amongst $n$ integrated-circuit chips produced by a factory (any number of defects may be found on a chip and each defect is independent of the other defects).
工場で製造される IC チップ $n$ 個において $k$ 件の不良が不規則に生じます (1 個のチップに何件でも不良が生じる可能性があり、それぞれの不良は他の不良から独立しています)。
Let $p(k,n)$ represent the probability that there is a chip with at least 3 defects. For instance $p(3,7) ≈ 0.0204081633$.
少なくとも 3 件の不良を持つチップが存在する確率を、$p(k,n)$ とします。 例えば、$p(3,7) ≈ 0.0204081633$ です。
Find $p(20\\,000, 1\\,000\\,000)$ and give your answer rounded to 10 decimal places in the form 0.abcdefghij
$p(20\\,000, 1\\,000\\,000)$ を求め、小数第 10 位に四捨五入して 0.abcdefghij の形式弟答えなさい。
# --hints--
`chipDefects()` should return `0.7311720251`.
`chipDefects()` `0.7311720251` を返す必要があります。
```js
assert.strictEqual(chipDefects(), 0.7311720251);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a11000cf542c50ffb3
title: 'Problem 308: An amazing Prime-generating Automaton'
title: '問題 308: 驚くべき素数生成オートマトン'
challengeType: 5
forumTopicId: 301962
dashedName: problem-308-an-amazing-prime-generating-automaton
@ -8,27 +8,27 @@ dashedName: problem-308-an-amazing-prime-generating-automaton
# --description--
A program written in the programming language Fractran consists of a list of fractions.
プログラミング言語 Fractran で書かれたプログラムは、分数のリストで構成されています。
The internal state of the Fractran Virtual Machine is a positive integer, which is initially set to a seed value. Each iteration of a Fractran program multiplies the state integer by the first fraction in the list which will leave it an integer.
Fractran 仮想マシンの内部状態は正の整数で、最初はシード値に設定されます。 Fractran プログラムは 1 回の反復ごとに、状態整数にリストの最初の分数を乗じて整数を得ます。
For example, one of the Fractran programs that John Horton Conway wrote for prime-generation consists of the following 14 fractions:
例えば、ジョン・ホートン・コンウェイが素数生成用に作成した Fractran プログラムの一つは、次の 14 個の分数で構成されています。
$$\frac{17}{91}, \frac{78}{85}, \frac{19}{51}, \frac{23}{38}, \frac{29}{33}, \frac{77}{29}, \frac{95}{23}, \frac{77}{19}, \frac{1}{17}, \frac{11}{13}, \frac{13}{11}, \frac{15}{2}, \frac{1}{7}, \frac{55}{1}$$
Starting with the seed integer 2, successive iterations of the program produce the sequence:
整数 2 のシード値から始めてプログラムの反復を続けると、次の数列が生成されます。
$$15, 825, 725, 1925, 2275, 425, \ldots, 68, \mathbf{4}, 30, \ldots, 136, \mathbf{8}, 60, \ldots, 544, \mathbf{32}, 240, \ldots$$
The powers of 2 that appear in this sequence are $2^2, 2^3, 2^5, \ldots$.
この数列に現れる 2 の累乗は $2^2, 2^3, 2^5, \ldots$ です。
It can be shown that all the powers of 2 in this sequence have prime exponents and that all the primes appear as exponents of powers of 2, in proper order!
この数列にある 2 の累乗はいずれも指数が素数であること、および、すべての素数が 2 の累乗の指数として順序通りに現れるということを示せます。
If someone uses the above Fractran program to solve Project Euler Problem 7 (find the ${10001}^{\text{st}}$ prime), how many iterations would be needed until the program produces $2^{10001^{\text{st}}\text{ prime}}$?
上の Fractran のプログラムを使用してプロジェクト・オイラーの問題 7 (${10001}$ 番目の素数を求める) を解くとしたら、$2^{10001 {\text{ 番目の}}\text{素数}}$ を生成するまでにプログラムを何回反復する必要がありますか。
# --hints--
`primeGeneratingAutomation()` should return `1539669807660924`.
`primeGeneratingAutomation()` `1539669807660924` を返す必要があります 。
```js
assert.strictEqual(primeGeneratingAutomation(), 1539669807660924);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a11000cf542c50ffb4
title: 'Problem 309: Integer Ladders'
title: '問題 309: 整数のはしご'
challengeType: 5
forumTopicId: 301963
dashedName: problem-309-integer-ladders
@ -8,19 +8,19 @@ dashedName: problem-309-integer-ladders
# --description--
In the classic "Crossing Ladders" problem, we are given the lengths $x$ and $y$ of two ladders resting on the opposite walls of a narrow, level street. We are also given the height $h$ above the street where the two ladders cross and we are asked to find the width of the street ($w$).
古典的な「交差するはしご」問題では、それぞれの長さが $x$ $y$ のはしご 2 本が、狭く平らな道の両壁に 1 本ずつ立て掛けられています。 また、2 本のはしごが交差する個所の、路面からの高さ $h$ が与えられ、道幅 ($w$) を導くよう求められます。
<img class="img-responsive center-block" alt="ladders x and y, crossing at the height h, and resting on opposite walls of the street of width w" src="https://cdn.freecodecamp.org/curriculum/project-euler/integer-ladders.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="はしご x と y が高さ h で交差し、幅 w の道の両壁に立て掛けられている" src="https://cdn.freecodecamp.org/curriculum/project-euler/integer-ladders.gif" style="background-color: white; padding: 10px;" />
Here, we are only concerned with instances where all four variables are positive integers. For example, if $x = 70$, $y = 119$ and $h = 30$, we can calculate that $w = 56$.
ここでは、4 つの変数がすべて正の整数であるケースのみを扱います。 例えば、$x = 70$, $y = 119$, $h = 30$ の場合、$w = 56$ と計算できます。
In fact, for integer values $x$, $y$, $h$ and $0 &lt; x &lt; y &lt; 200$, there are only five triplets ($x$, $y$, $h$) producing integer solutions for $w$: (70, 119, 30), (74, 182, 21), (87, 105, 35), (100, 116, 35) and (119, 175, 40).
実は、整数値 $x$, $y$, $h$ および $0 &lt; x &lt; y &lt; 200$ に対し、$w$ の整数解となる三つ組数 ($x$, $y$, $h$) は、(70, 119, 30), (74, 182, 21), (87, 105, 35), (100, 116, 35), (119, 175, 40) の 5 つだけです。
For integer values $x$, $y$, $h$ and $0 &lt; x &lt; y &lt; 1\\,000\\,000$, how many triplets ($x$, $y$, $h$) produce integer solutions for $w$?
整数値 $x$, $y$, $h$ および $0 &lt; x &lt; y &lt; 1\\,000\\,000$ に対し、$w$ が整数解となる三つ組数 ($x$, $y$, $h$) はいくつありますか。
# --hints--
`integerLadders()` should return `210139`.
`integerLadders()` `210139` を返す必要があります。
```js
assert.strictEqual(integerLadders(), 210139);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a21000cf542c50ffb5
title: 'Problem 310: Nim Square'
title: '問題 310: ニム平方数'
challengeType: 5
forumTopicId: 301966
dashedName: problem-310-nim-square
@ -8,19 +8,19 @@ dashedName: problem-310-nim-square
# --description--
Alice and Bob play the game Nim Square.
アリスとボブが「ニム平方数」というゲームをします。
Nim Square is just like ordinary three-heap normal play Nim, but the players may only remove a square number of stones from a heap.
ニム平方数は、3 つの石の山を使う通常のニムと似ていますが、プレイヤーは 1 つの山から平方数個の石を取らなければなりません。
The number of stones in the three heaps is represented by the ordered triple ($a$, $b$, $c$).
3 つの山に積まれた石の数を、3 つの数の順序組 ($a$ $b$, $c$) として表します。
If $0 ≤ a ≤ b ≤ c ≤ 29$ then the number of losing positions for the next player is 1160.
$0 ≤ a ≤ b ≤ c ≤ 29$ の場合、次のプレイヤーが負けるポジションは 1160 個あります。
Find the number of losing positions for the next player if $0 ≤ a ≤ b ≤ c ≤ 100\\,000$.
$0 ≤ a ≤ b ≤ c ≤ 100\\,000$ の場合に次のプレイヤーが負けるポジションの数を求めなさい。
# --hints--
`nimSquare()` should return `2586528661783`.
`nimSquare()` `2586528661783` を返す必要があります。
```js
assert.strictEqual(nimSquare(), 2586528661783);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a31000cf542c50ffb6
title: 'Problem 311: Biclinic Integral Quadrilaterals'
title: '問題 311: 二斜整数四辺形'
challengeType: 5
forumTopicId: 301967
dashedName: problem-311-biclinic-integral-quadrilaterals
@ -8,23 +8,23 @@ dashedName: problem-311-biclinic-integral-quadrilaterals
# --description--
$ABCD$ is a convex, integer sided quadrilateral with $1 ≤ AB &lt; BC &lt; CD &lt; AD$.
四角形 $ABCD$ は、$1 ≤ AB &lt; BC &lt; CD &lt; AD$ かつ辺長が整数である凸四角形です。
$BD$ has integer length. $O$ is the midpoint of $BD$. $AO$ has integer length.
$BD$ の長さは整数です。 $O$ は $BD$ の中点です。 $AO$ の長さは整数です。
We'll call $ABCD$ a biclinic integral quadrilateral if $AO = CO ≤ BO = DO$.
$AO = CO ≤ BO = DO$ の場合、$ABCD$ を「二斜整数四辺形」(biclinic integral quadrilateral) と呼ぶことにします。
For example, the following quadrilateral is a biclinic integral quadrilateral: $AB = 19$, $BC = 29$, $CD = 37$, $AD = 43$, $BD = 48$ and $AO = CO = 23$.
例えば、下の四辺形は $AB = 19$, $BC = 29$, $CD = 37$, $AD = 43$, $BD = 48$, $AO = CO = 23$ であり、二斜整数四角形です。
<img class="img-responsive center-block" alt="quadrilateral ABCD, with point O, an midpoint of BD" src="https://cdn.freecodecamp.org/curriculum/project-euler/biclinic-integral-quadrilaterals.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="BD の中点を点 O とする四辺形 ABCD" src="https://cdn.freecodecamp.org/curriculum/project-euler/biclinic-integral-quadrilaterals.gif" style="background-color: white; padding: 10px;" />
Let $B(N)$ be the number of distinct biclinic integral quadrilaterals $ABCD$ that satisfy ${AB}^2 + {BC}^2 + {CD}^2 + {AD}^2 ≤ N$. We can verify that $B(10\\,000) = 49$ and $B(1\\,000\\,000) = 38239$.
${AB}^2 + {BC}^2 + {CD}^2 + {AD}^2 ≤ N$ を満たす相異なる二斜整数四角形 $ABCD$ の数を、$B(N)$ とします。 $B(10\\000) = 49$, $B(1\\,000\\000) = 38239$ であることを確認できます。
Find $B(10\\,000\\,000\\,000)$.
$B(10\\,000\\,000\\,000)$ を求めなさい。
# --hints--
`biclinicIntegralQuadrilaterals()` should return `2466018557`.
`biclinicIntegralQuadrilaterals()` `2466018557` を返す必要があります。
```js
assert.strictEqual(biclinicIntegralQuadrilaterals(), 2466018557);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a51000cf542c50ffb7
title: 'Problem 312: Cyclic paths on Sierpiński graphs'
title: '問題 312: シェルピンスキーグラフ上の循環路'
challengeType: 5
forumTopicId: 301968
dashedName: problem-312-cyclic-paths-on-sierpiski-graphs
@ -8,24 +8,24 @@ dashedName: problem-312-cyclic-paths-on-sierpiski-graphs
# --description--
- A Sierpiński graph of order-1 ($S_1$) is an equilateral triangle.
- $S_{n + 1}$ is obtained from $S_n$ by positioning three copies of $S_n$ so that every pair of copies has one common corner.
- 位数 1 のシェルピンスキーグラフ ($S_1$) は正三角形です。
- $S_{n + 1}$ は $S_n$ から作られます。3 つの $S_n$ を、それぞれの対が角の 1 つの頂点を共有するように配置したものです。
<img class="img-responsive center-block" alt="Sierpinski graphs of order-1 to order-5" src="https://cdn.freecodecamp.org/curriculum/project-euler/cyclic-paths-on-sierpinski-graphs-1.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="位数1 から 位数 5 のシェルピンスキーグラフ" src="https://cdn.freecodecamp.org/curriculum/project-euler/cyclic-paths-on-sierpinski-graphs-1.gif" style="background-color: white; padding: 10px;" />
Let $C(n)$ be the number of cycles that pass exactly once through all the vertices of $S_n$. For example, $C(3) = 8$ because eight such cycles can be drawn on $S_3$, as shown below:
$S_n$ のすべての頂点をちょうど 1 回ずつ通る循環路の数を、$C(n)$ とします。 例えば、下図のとおり、$S_3$ にそのような循環路を 8 つ描くことができるので、$C(3) = 8$ です。
<img class="img-responsive center-block" alt="eight cycles that pass exactly once through all vertices of S_3" src="https://cdn.freecodecamp.org/curriculum/project-euler/cyclic-paths-on-sierpinski-graphs-2.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="S_3 の全頂点を通る 8 つの循環路" src="https://cdn.freecodecamp.org/curriculum/project-euler/cyclic-paths-on-sierpinski-graphs-2.gif" style="background-color: white; padding: 10px;" />
It can also be verified that:
次のことも確認できます。
$$\begin{align} & C(1) = C(2) = 1 \\\\ & C(5) = 71\\,328\\,803\\,586\\,048 \\\\ & C(10 000)\bmod {10}^8 = 37\\,652\\,224 \\\\ & C(10 000)\bmod {13}^8 = 617\\,720\\,485 \\\\ \end{align}$$
Find $C(C(C(10\\,000)))\bmod {13}^8$.
$C(C(C(10\\,000)))\bmod {13}^8$ を求めなさい。
# --hints--
`pathsOnSierpinskiGraphs()` should return `324681947`.
`pathsOnSierpinskiGraphs()` `324681947` を返す必要があります。
```js
assert.strictEqual(pathsOnSierpinskiGraphs(), 324681947);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a61000cf542c50ffb8
title: 'Problem 313: Sliding game'
title: 'Problem 313: スライドゲーム'
challengeType: 5
forumTopicId: 301969
dashedName: problem-313-sliding-game
@ -8,21 +8,21 @@ dashedName: problem-313-sliding-game
# --description--
In a sliding game a counter may slide horizontally or vertically into an empty space. The objective of the game is to move the red counter from the top left corner of a grid to the bottom right corner; the space always starts in the bottom right corner. For example, the following sequence of pictures show how the game can be completed in five moves on a 2 by 2 grid.
スライドゲームでは、カウンターを縦か横にスライドさせて空のスペースに移動します。 ゲームの目的は、赤のカウンターを格子の左上隅から右下隅へ移動することです。開始時は必ず右下隅が空いています。 例えば、次の一連の画像は、2 × 2 の格子上で 5 手でゲームを終える方法を示しています。
<img class="img-responsive center-block" alt="completing game in five moves on grid 2x2" src="https://cdn.freecodecamp.org/curriculum/project-euler/sliding-game-1.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="2 x 2 の格子でゲームを終える" src="https://cdn.freecodecamp.org/curriculum/project-euler/sliding-game-1.gif" style="background-color: white; padding: 10px;" />
Let $S(m, n)$ represent the minimum number of moves to complete the game on an $m$ by $n$ grid. For example, it can be verified that $S(5, 4) = 25$.
$m$ x $n$ の格子でゲームを終えるための最小移動回数を、$S(m, n)$ とします。 例えば、$S(5, 4) = 25$ であることを確認できます。
<img class="img-responsive center-block" alt="initial grid state and final grid state for game on grid 5x4" src="https://cdn.freecodecamp.org/curriculum/project-euler/sliding-game-2.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="5 x 4 の格子を使ったゲームの初期状態と最終状態" src="https://cdn.freecodecamp.org/curriculum/project-euler/sliding-game-2.gif" style="background-color: white; padding: 10px;" />
There are exactly 5482 grids for which $S(m, n) = p^2$, where $p &lt; 100$ is prime.
素数 $p &lt; 100$ について、$S(m, n) = p^2$ となる格子はちょうど 5482 個あります。
How many grids does $S(m, n) = p^2$, where $p &lt; {10}^6$ is prime?
素数 $p &lt; {10}^6$ について、$S(m, n) = p^2$ となる格子はいくつありますか。
# --hints--
`slidingGame()` should return `2057774861813004`.
`slidingGame()` `2057774861813004` を返す必要があります。
```js
assert.strictEqual(slidingGame(), 2057774861813004);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a71000cf542c50ffb9
title: 'Problem 314: The Mouse on the Moon'
title: '問題 314: 『小鼠 月世界を征服』'
challengeType: 5
forumTopicId: 301970
dashedName: problem-314-the-mouse-on-the-moon
@ -8,23 +8,23 @@ dashedName: problem-314-the-mouse-on-the-moon
# --description--
The moon has been opened up, and land can be obtained for free, but there is a catch. You have to build a wall around the land that you stake out, and building a wall on the moon is expensive. Every country has been allotted a 500 m by 500 m square area, but they will possess only that area which they wall in. 251001 posts have been placed in a rectangular grid with 1 meter spacing. The wall must be a closed series of straight lines, each line running from post to post.
月が開拓され、土地を無料で取得できるようになりました。しかし、1 つ問題があります。 確保した土地を壁で囲まなければなりませんが、月では壁を作るのにとてもお金がかかるのです。 各国には 500 m × 500 m の正方形の土地が割り当てられていますが、所有できるのは壁で囲んだ部分だけです。251001 本の杭が 1 m 間隔で長方形の格子状に配置されています。 壁は、閉じられた連続的直線でなければならず、それぞれの直線は杭と杭を結ぶものでなければなりません。
The bigger countries of course have built a 2000 m wall enclosing the entire 250 000 $\text{m}^2$ area. The Duchy of Grand Fenwick, has a tighter budget, and has asked you (their Royal Programmer) to compute what shape would get best maximum $\frac{\text{enclosed-area}}{\text{wall-length}}$ ratio.
もちろん大国は 2000 m の壁を建設し、面積 250 000 $\text{m}^2$ の土地の全体を囲んでいます。 グランド・フェンウィック大公国は予算が厳しいため、皇帝プログラマーであるあなたに、$\frac{\text{囲まれた土地の面積}}{\text{壁の長さ}}$の比率が最も高くなるのはどのような形状かを計算するよう指示しました。
You have done some preliminary calculations on a sheet of paper. For a 2000 meter wall enclosing the 250 000 $\text{m}^2$ area the $\frac{\text{enclosed-area}}{\text{wall-length}}$ ratio is 125.
あなたは紙の上で予備的な計算を行いました。 2000 メートルの壁で 250 000 $\text{m}^2$ の土地を囲んだ場合、$\frac{\text{囲まれた土地の面積}}{\text{壁の長さ}}$の比率は 125 です。
Although not allowed, but to get an idea if this is anything better: if you place a circle inside the square area touching the four sides the area will be equal to $π \times {250}^2 \text{m}^2$ and the perimeter will be $π \times 500 \text{m}$, so the $\frac{\text{enclosed-area}}{\text{wall-length}}$ ratio will also be 125.
規則には沿っていませんが、次の方法で比率が高くなるかどうかを考えてみます。正方形の土地の四辺に接するように円を入れると、面積は $π \times {250}^2 \text{m}^2$、周長は $π \times 500 \text{m}$ となり、この場合も、$\frac{\text{囲まれた土地の面積}}{\text{壁の長さ}}$の比率は 125 です。
However, if you cut off from the square four triangles with sides 75 m, 75 m and $75\sqrt{2}$ m the total area becomes 238750 $\text{m}^2$ and the perimeter becomes $1400 + 300\sqrt{2}$ m. So this gives an $\frac{\text{enclosed-area}}{\text{wall-length}}$ ratio of 130.87, which is significantly better.
しかし、辺が 75 m, 75 m, $75\sqrt{2}$ m の 三角形を土地の 4 隅 から切り離すと、面積は238750 $\text{m}^2$、周長は $1400 + 300\sqrt{2}$ m になります。 すると、$\frac{\text{囲まれた土地の面積}}{\text{壁の長さ}}$の比率は 130.87 で、先程より大幅に高くなります。
<img class="img-responsive center-block" alt="picture showing difference in encosed-area between circle and square with cut off four triangles" src="https://cdn.freecodecamp.org/curriculum/project-euler/the-mouse-on-the-moon.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="壁に囲まれた土地の面積が、円形の場合と、正方形から 4 つの三角形を切り取った場合とでどのように違うかを示す図" src="https://cdn.freecodecamp.org/curriculum/project-euler/the-mouse-on-the-moon.gif" style="background-color: white; padding: 10px;" />
Find the maximum $\frac{\text{enclosed-area}}{\text{wall-length}}$ ratio. Give your answer rounded to 8 places behind the decimal point in the form abc.defghijk.
$\frac{\text{囲まれた土地の面積}}{\text{壁の長さ}}$の比率の最大値を求めなさい。 回答は、四捨五入して小数第 8 位まで求め、abc.defghijk の形式にすること。
# --hints--
`theMouseOnTheMoon()` should return `132.52756426`.
`theMouseOnTheMoon()` `132.52756426` を返す必要があります。
```js
assert.strictEqual(theMouseOnTheMoon(), 132.52756426);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a71000cf542c50ffba
title: 'Problem 315: Digital root clocks'
title: '問題 315: 数字根時計'
challengeType: 5
forumTopicId: 301971
dashedName: problem-315-digital-root-clocks
@ -8,45 +8,45 @@ dashedName: problem-315-digital-root-clocks
# --description--
<img class="img-responsive center-block" alt="animation of Sam's and Max's clocks calculating digital roots starting from 137" src="https://cdn.freecodecamp.org/curriculum/project-euler/digital-root-clocks.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="137 から始まり数字根を計算する、サムとマックスの時計のアニメーション" src="https://cdn.freecodecamp.org/curriculum/project-euler/digital-root-clocks.gif" style="background-color: white; padding: 10px;" />
Sam and Max are asked to transform two digital clocks into two "digital root" clocks.
サムとマックスは、2 台のデジタル時計を数字根時計に作り変えるよう頼まれました。
A digital root clock is a digital clock that calculates digital roots step by step.
数字根時計とは、数字根を 1 ステップずつ計算するデジタル時計です。
When a clock is fed a number, it will show it and then it will start the calculation, showing all the intermediate values until it gets to the result. For example, if the clock is fed the number 137, it will show: `137``11``2` and then it will go black, waiting for the next number.
数字が入力されると、時計はその数字を表示してから計算を開始し、結果が出るまでの中間値をすべて表示します。 例えば数字 137 が入力されると、`137``11``2` と表示した後、表示を消して次の数字を待ちます。
Every digital number consists of some light segments: three horizontal (top, middle, bottom) and four vertical (top-left, top-right, bottom-left, bottom-right). Number `1` is made of vertical top-right and bottom-right, number `4` is made by middle horizontal and vertical top-left, top-right and bottom-right. Number `8` lights them all.
各デジタル数字を構成する発光セグメントは、横方向に 3 本 (上、中、下) と縦方向に 4 本 (左上、右上、左下、右下) あります。 数字 `1` は右上と右下の縦セグメント、数字 `4` は中央の横セグメントと、左上、右上、右下の縦セグメントで作られます。 数字 `8` では全セグメントが点灯します。
The clocks consume energy only when segments are turned on/off. To turn on a `2` will cost 5 transitions, while a `7` will cost only 4 transitions.
この時計は、セグメントを点灯 / 消灯させたときのみエネルギーを消費します。 `2` を点灯させるには 5 回の遷移が必要ですが、`7` では 4 回しか遷移しません。
Sam and Max built two different clocks.
サムとマックスはそれぞれ異なる時計を作りました。
Sam's clock is fed e.g. number 137: the clock shows `137`, then the panel is turned off, then the next number (`11`) is turned on, then the panel is turned off again and finally the last number (`2`) is turned on and, after some time, off.
サムの時計に例えば 137 が入力されると、時計は `137` を表示した後、表示を消し、次の数字 (`11`) を表示し、再び表示を消し、最終的に最後の数字 (`2`) を表示し、しばらくすると消えます。
For the example, with number 137, Sam's clock requires:
この例 (数字 137) では、サムの時計は次のように遷移します。
- `137`: $(2 + 5 + 4) × 2 = 22$ transitions (`137` on/off).
- `11`: $(2 + 2) × 2 = 8$ transitions (`11` on/off).
- `2`: $(5) × 2 = 10$ transitions (`2` on/off).
- `137`: $(2 + 5 + 4) × 2 = 22$ 回の遷移 (`137` の点灯と消灯)
- `11`: $(2 + 2) × 2 = 8$ 回の遷移 (`11` の点灯と消灯)
- `2`: $(5) × 2 = 10$ 回の遷移 (`2` の点灯と消灯)
For a grand total of 40 transitions.
計 40 回の遷移があります。
Max's clock works differently. Instead of turning off the whole panel, it is smart enough to turn off only those segments that won't be needed for the next number.
マックスの時計は、これとは違う動きをします。 パネル全体を消灯するのではなく、次の数に必要のないセグメントのみを消灯するという賢い方法です。
For number 137, Max's clock requires:
137 の場合、マックスの時計は次のように遷移します。
- `137` : $2 + 5 + 4 = 11$ transitions (`137` on), $7$ transitions (to turn off the segments that are not needed for number `11`).
- `11` : $0$ transitions (number `11` is already turned on correctly), $3$ transitions (to turn off the first `1` and the bottom part of the second `1`; the top part is common with number `2`).
- `2` : $4$ transitions (to turn on the remaining segments in order to get a `2`), $5$ transitions (to turn off number `2`).
- `137`: $(2 + 5 + 4) × 2 = 11$ 回の遷移 (`137` の点灯)、$7$ 回の遷移 (`11` に不要なセグメントを消灯)
- `11` : $0$ 回の遷移 (数字 `11` は正しく点灯済み)、$3$ 回の遷移 (1 つ目の `1` と、2 つ目の `1` の下部を消灯、上部は数字 `2` と共通)
- `2` : $4$ 回の遷移 (`2` を作るために残りのセグメントを点灯)、$5$ 回の遷移 (数字 `2` を消灯)
For a grand total of 30 transitions.
計 30 回の遷移があります。
Of course, Max's clock consumes less power than Sam's one. The two clocks are fed all the prime numbers between $A = {10}^7$ and $B = 2 × {10}^7$. Find the difference between the total number of transitions needed by Sam's clock and that needed by Max's one.
当然ながら、マックスの時計はサムの時計よりも消費電力が少なくなります。 2 台の時計に、$A = {10}^7$ から $B = 2 × {10}^7$ までの全素数を入力します。 サムの時計で必要な遷移の総数と、マックスの時計で必要な遷移の総数との差を求めなさい。
# --hints--
`digitalRootClocks()` should return `13625242`.
`digitalRootClocks()` `13625242` を返す必要があります。
```js
assert.strictEqual(digitalRootClocks(), 13625242);

View File

@ -1,6 +1,6 @@
---
id: 5900f4a81000cf542c50ffbb
title: 'Problem 316: Numbers in decimal expansions'
title: '問題 316: 10 進展開の数字'
challengeType: 5
forumTopicId: 301972
dashedName: problem-316-numbers-in-decimal-expansions
@ -8,31 +8,31 @@ dashedName: problem-316-numbers-in-decimal-expansions
# --description--
Let $p = p_1 p_2 p_3 \ldots$ be an infinite sequence of random digits, selected from {0,1,2,3,4,5,6,7,8,9} with equal probability.
{0,1,2,3,4,5,6,7,8,9} から等しい確率で選択された不規則な数字からなる無限数列を、$p = p_1 p_2 p_3 \ldots$ とします。
It can be seen that $p$ corresponds to the real number $0.p_1 p_2 p_3 \ldots$.
$p$ は実数 $0.p_1 p_2 p_3 \ldots$ に対応するということが分かります。
It can also be seen that choosing a random real number from the interval [0,1) is equivalent to choosing an infinite sequence of random digits selected from {0,1,2,3,4,5,6,7,8,9} with equal probability.
また、区間 [0,1) から無作為に実数を選ぶことは、{0,1,2,3,4,5,6,7,8,9} から等しい確率で選択した不規則な数字からなる無限数列を選ぶことと同等であることも分かります。
For any positive integer $n$ with $d$ decimal digits, let $k$ be the smallest index such that $p_k, p_{k + 1}, \ldots p_{k + d - 1}$ are the decimal digits of $n$, in the same order.
$d$ 個の小数桁を持つ任意の正の整数 $n$ に対して、$p_k, p_{k + 1}, \dots p_{k + d - 1}$ が数字の順序も含めて $n$ の小数桁と同じになるような、最小の添え字を $k$ とします。
Also, let $g(n)$ be the expected value of $k$; it can be proven that $g(n)$ is always finite and, interestingly, always an integer number.
また、$k$ の期待値を $g(n)$ とします。$g(n)$ が常に有限であること、そして興味深いことに常に整数であることを証明できます。
For example, if $n = 535$, then
例えば、$n = 535$ の場合、
for $p = 31415926\mathbf{535}897\ldots$, we get $k = 9$
$p = 31415926\mathbf{535}897\ldots$ のとき、$k = 9$ です。
for $p = 35528714365004956000049084876408468\mathbf{535}4\ldots$, we get $k = 36$
$p = 35528714365004956000049084876408468\mathbf{535}4\ldots$ のとき、$k = 36$ です。
etc and we find that $g(535) = 1008$.
同様に、$g(535) = 1008$ であることが分かります。
Given that $\displaystyle\sum_{n = 2}^{999} g\left(\left\lfloor\frac{{10}^6}{n}\right\rfloor\right) = 27280188$, find $\displaystyle\sum_{n = 2}^{999\\,999} g\left(\left\lfloor\frac{{10}^{16}}{n}\right\rfloor\right)$.
$\displaystyle\sum_{n = 2}^{999} g\left(\left\lfloor\frac{{10}^6}{n}\right\rfloor\right) = 27280188$ が与えられるとき、$\displaystyle\sum_{n = 2}^{999\\,999} g\left(\left\lfloor\frac{{10}^{16}}{n}\right\rfloor\right)$ を求めなさい。
**Note:** $\lfloor x\rfloor$ represents the floor function.
**:** $\lfloor x\rfloor$ は床関数を表します。
# --hints--
`numbersInDecimalExpansion()` should return `542934735751917760`.
`numbersInDecimalExpansion()` `542934735751917760` を返す必要があります。
```js
assert.strictEqual(numbersInDecimalExpansion(), 542934735751917760);

View File

@ -1,6 +1,6 @@
---
id: 5900f4aa1000cf542c50ffbc
title: 'Problem 317: Firecracker'
title: '問題 317: 爆竹'
challengeType: 5
forumTopicId: 301973
dashedName: problem-317-firecracker
@ -8,15 +8,15 @@ dashedName: problem-317-firecracker
# --description--
A firecracker explodes at a height of 100 m above level ground. It breaks into a large number of very small fragments, which move in every direction; all of them have the same initial velocity of 20 $\frac{\text{m}}{\text{s}}$.
ある爆竹は地上 100 m の高さで爆発します。 爆発すると、無数の微小な破片に分かれてあらゆる方向に飛び散ります。いずれの破片も初速は 20 $\frac{\text{m}}{\text{s}}$ です。
We assume that the fragments move without air resistance, in a uniform gravitational field with $g=9.81 \frac{\text{m}}{\text{s}^2}$.
$g=9.81 \frac{\text{m}}{\text{s}^2}$ の一様な重力場で、破片が空気抵抗を受けずに動くと仮定します。
Find the volume (in $\text{m}^3$) of the region through which the fragments move before reaching the ground. Give your answer rounded to four decimal places.
破片が地面に到達する前に移動する領域の体積 ($\text{m}^3$) を求めなさい。 回答は、四捨五入して小数第 4 位まで示すこと。
# --hints--
`firecracker()` should return `1856532.8455`.
`firecracker()` `1856532.8455` を返す必要があります。
```js
assert.strictEqual(firecracker(), 1856532.8455);

View File

@ -1,6 +1,6 @@
---
id: 5900f4ab1000cf542c50ffbd
title: 'Problem 318: 2011 nines'
title: '問題 318: 2011 個の 9'
challengeType: 5
forumTopicId: 301974
dashedName: problem-318-2011-nines
@ -8,25 +8,25 @@ dashedName: problem-318-2011-nines
# --description--
Consider the real number $\sqrt{2} + \sqrt{3}$.
実数 $\sqrt{2} + \sqrt{3}$ について考えます。
When we calculate the even powers of $\sqrt{2} + \sqrt{3}$ we get:
$\sqrt{2} + \sqrt{3}$ の偶数乗を計算すると、次のようになります。
$$\begin{align} & {(\sqrt{2} + \sqrt{3})}^2 = 9.898979485566356\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^4 = 97.98979485566356\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^6 = 969.998969071069263\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^8 = 9601.99989585502907\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^{10} = 95049.999989479221\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^{12} = 940897.9999989371855\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^{14} = 9313929.99999989263\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^{16} = 92198401.99999998915\ldots \\\\ \end{align}$$
It looks like that the number of consecutive nines at the beginning of the fractional part of these powers is non-decreasing. In fact it can be proven that the fractional part of ${(\sqrt{2} + \sqrt{3})}^{2n}$ approaches 1 for large $n$.
これらの累乗の分数部を見ると、先頭で連続している 9 の個数が非減少であるように見えます。 実際に、$n$ が大きいと ${(\sqrt{2} + \sqrt{3})}^{2n}$ の小数部が 1 に近付くということを証明できます。
Consider all real numbers of the form $\sqrt{p} + \sqrt{q}$ with $p$ and $q$ positive integers and $p &lt; q$, such that the fractional part of ${(\sqrt{p} + \sqrt{q})}^{2n}$ approaches 1 for large $n$.
正の整数 $p$ $q$ ($p &lt; q$) があるとき、$n$ が大きいと ${(\sqrt{p} + \sqrt{q})}^{2n}$ の小数部 が 1 に近付くようなすべての実数 $\sqrt{p} + \sqrt{q}$ について考えます。
Let $C(p,q,n)$ be the number of consecutive nines at the beginning of the fractional part of ${(\sqrt{p} + \sqrt{q})}^{2n}$.
${(\sqrt{p} + \sqrt{q})}^{2n}$ の小数部の先頭で連続している 9 の個数を $C(p,q,n)$ とします。
Let $N(p,q)$ be the minimal value of $n$ such that $C(p,q,n) ≥ 2011$.
$C(p,q,n) ≥ 2011$ を満たす $n$ の最小値を $N(p,q)$ とします。
Find $\sum N(p,q)$ for $p + q ≤ 2011$.
$p + q ≤ 2011$ のとき、$\sum N(p,q)$ を求めなさい。
# --hints--
`twoThousandElevenNines()` should return `709313889`.
`twoThousandElevenNines()` `709313889` を返す必要があります。
```js
assert.strictEqual(twoThousandElevenNines(), 709313889);

View File

@ -1,6 +1,6 @@
---
id: 5900f4ab1000cf542c50ffbe
title: 'Problem 319: Bounded Sequences'
title: '問題 319: 有界数列'
challengeType: 5
forumTopicId: 301975
dashedName: problem-319-bounded-sequences
@ -8,21 +8,21 @@ dashedName: problem-319-bounded-sequences
# --description--
Let $x_1, x_2, \ldots, x_n$ be a sequence of length $n$ such that:
次の条件を満たす長さ $n$ の数列を $x_1, x_2, \ldots, x_n$ とします。
- $x_1 = 2$
- for all $1 &lt; i ≤ n : x_{i - 1} &lt; x_i$
- for all $i$ and $j$ with $1 ≤ i, j ≤ n : {(x_i)}^j &lt; {(x_j + 1)}^i$
- すべての $1 &lt; i ≤ n について、x_{i - 1} &lt; x_i$
- $1 ≤ i, j ≤ n を満たすすべての $i$, $j$ について、{(x_i)}^j &lt; {(x_j + 1)}^i$
There are only five such sequences of length 2, namely: {2,4}, {2,5}, {2,6}, {2,7} and {2,8}. There are 293 such sequences of length 5; three examples are given below: {2,5,11,25,55}, {2,6,14,36,88}, {2,8,22,64,181}.
これらを満たす長さ 2 の数列は、{2,4}, {2,5}, {2,6}, {2,7}, {2,8} の 5 つしか存在しません。 これらを満たす長さ 5 の数列は 293 個あり、そのうち 3 例は {2,5,11,25,55}, {2,6,14,36,88}, {2,8,22,64,181} です。
Let $t(n)$ denote the number of such sequences of length $n$. You are given that $t(10) = 86195$ and $t(20) = 5227991891$.
長さ $n$ のそのような数列を $t(n)$ とします。 $t(10) = 86195$ $t(20) = 5227991891$ が与えられます。
Find $t({10}^{10})$ and give your answer modulo $10^9$.
$t({10}^{10})$ を求め、mod $10^9$ で答えなさい。
# --hints--
`boundedSequences()` should return `268457129`.
`boundedSequences()` `268457129` を返す必要があります。
```js
assert.strictEqual(boundedSequences(), 268457129);

View File

@ -1,6 +1,6 @@
---
id: 5900f4ae1000cf542c50ffbf
title: 'Problem 320: Factorials divisible by a huge integer'
title: '問題 320: 巨大な整数で割り切れる階乗'
challengeType: 5
forumTopicId: 301977
dashedName: problem-320-factorials-divisible-by-a-huge-integer
@ -8,17 +8,17 @@ dashedName: problem-320-factorials-divisible-by-a-huge-integer
# --description--
Let $N(i)$ be the smallest integer $n$ such that $n!$ is divisible by $(i!)^{1234567890}$
$n!$ が $(i!)^{1234567890}$ で割り切れるような最小の整数 $n$ を $N(i)$ とします。
Let $S(u) = \sum N(i)$ for $10 ≤ i ≤ u$.
$10 ≤ i ≤ u$ に対し、$S(u) = \sum N(i)$ と定義します。
$S(1000)=614\\,538\\,266\\,565\\,663$.
$S(1000)=614\\,538\\,266\\,565\\,663$ です。
Find $S(1\\,000\\,000)\bmod {10}^{18}$.
$S(1\\,000\\,000)\bmod {10}^{18}$ を求めなさい。
# --hints--
`divisibleByHugeInteger()` should return `278157919195482660`.
`divisibleByHugeInteger()` `278157919195482660` を返す必要があります。
```js
assert.strictEqual(divisibleByHugeInteger(), 278157919195482660);

View File

@ -1,6 +1,6 @@
---
id: 5900f4ae1000cf542c50ffc0
title: 'Problem 321: Swapping Counters'
title: '問題 321: カウンターを入れ替える'
challengeType: 5
forumTopicId: 301978
dashedName: problem-321-swapping-counters
@ -8,25 +8,25 @@ dashedName: problem-321-swapping-counters
# --description--
A horizontal row comprising of $2n + 1$ squares has $n$ red counters placed at one end and $n$ blue counters at the other end, being separated by a single empty square in the center. For example, when $n = 3$.
$2n + 1$ 個のマスが横方向に一列に並べられ、一方の端に $n$ 個の赤のカウンターが置かれ、もう一方の端に $n$ 個の青のカウンターが置かれ、その間の 1 マスは空いています。 例えば、$n = 3$ のときは下図のようになります。
<img class="img-responsive center-block" alt="three squares with red and blue counters placed on opposite ends of the row, separated by one empty square" src="https://cdn.freecodecamp.org/curriculum/project-euler/swapping-counters-1.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="列の両側の 3 マスに赤と青のカウンターが置かれ、間の 1 マスは空いている" src="https://cdn.freecodecamp.org/curriculum/project-euler/swapping-counters-1.gif" style="background-color: white; padding: 10px;" />
A counter can move from one square to the next (slide) or can jump over another counter (hop) as long as the square next to that counter is unoccupied.
カウンターは、あるマスから次のマスに移動したり (スライド)、別のカウンターの隣のマスが空いていればそのカウンターを飛び越えたり (ホップ) できます。
<img class="img-responsive center-block" alt="allowed moves of the counter" src="https://cdn.freecodecamp.org/curriculum/project-euler/swapping-counters-2.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="許容されるカウンターの動き方" src="https://cdn.freecodecamp.org/curriculum/project-euler/swapping-counters-2.gif" style="background-color: white; padding: 10px;" />
Let $M(n)$ represent the minimum number of moves/actions to completely reverse the positions of the colored counters; that is, move all the red counters to the right and all the blue counters to the left.
色付きカウンターの位置を完全に入れ替える (すなわち赤のカウンターをすべて右へ、青のカウンターをすべて左へ移動する) ための移動やアクションの最小回数を、$M(n)$ とします。
It can be verified $M(3) = 15$, which also happens to be a triangle number.
$M(3) = 15$ であることを確認できます。これは三角数でもあります。
If we create a sequence based on the values of n for which $M(n)$ is a triangle number then the first five terms would be: 1, 3, 10, 22, and 63, and their sum would be 99.
$M(n)$ が三角数となるような n の値に基づいて数列を作ると、最初の 5 項は 1, 3, 10, 22, 63 で、それらの和は 99 です。
Find the sum of the first forty terms of this sequence.
この数列の最初の 40 項の和を求めなさい。
# --hints--
`swappingCounters()` should return `2470433131948040`.
`swappingCounters()` `2470433131948040` を返す必要があります。
```js
assert.strictEqual(swappingCounters(), 2470433131948040);

View File

@ -1,6 +1,6 @@
---
id: 5900f4af1000cf542c50ffc1
title: 'Problem 322: Binomial coefficients divisible by 10'
title: '問題 322: 10 で割り切れる二項係数'
challengeType: 5
forumTopicId: 301979
dashedName: problem-322-binomial-coefficients-divisible-by-10
@ -8,15 +8,15 @@ dashedName: problem-322-binomial-coefficients-divisible-by-10
# --description--
Let $T(m, n)$ be the number of the binomial coefficients ${}^iC_n$ that are divisible by 10 for $n ≤ i &lt; m$ ($i$, $m$ and $n$ are positive integers).
$n ≤ i &lt; m$ ($i$, $m$, $n$ は正の整数) のとき、10 で割り切れる二項係数 ${}^iC_n$ の数を $T(m, n)$ とします。
You are given that $T({10}^9, {10}^7 - 10) = 989\\,697\\,000$.
$T({10}^9, {10}^7 - 10) = 989\\,697\\,000$ が与えられます。
Find $T({10}^{18}, {10}^{12} - 10)$.
$T({10}^{18}, {10}^{12} - 10)$ を求めなさい。
# --hints--
`binomialCoefficientsDivisibleBy10()` should return `999998760323314000`.
`binomialCoefficientsDivisibleBy10()` `999998760323314000` を返す必要があります。
```js
assert.strictEqual(binomialCoefficientsDivisibleBy10(), 999998760323314000);

View File

@ -1,6 +1,6 @@
---
id: 5900f4b01000cf542c50ffc2
title: 'Problem 323: Bitwise-OR operations on random integers'
title: '問題 323: 乱数整数のビット論理和演算'
challengeType: 5
forumTopicId: 301980
dashedName: problem-323-bitwise-or-operations-on-random-integers
@ -8,22 +8,22 @@ dashedName: problem-323-bitwise-or-operations-on-random-integers
# --description--
Let $y_0, y_1, y_2, \ldots$ be a sequence of random unsigned 32 bit integers
$y_0, y_1, y_2, \ldots$ を、符号なしの 32 ビット整数の数列とします
(i.e. $0 ≤ y_i &lt; 2^{32}$, every value equally likely).
(つまり、$0 ≤ y_i &lt; 2^{32}$ であり、すべての値が等しく現れ得ます)。
For the sequence $x_i$ the following recursion is given:
数列 $x_i$ について、次の反復が与えられます。
- $x_0 = 0$ and
- $x_i = x_{i - 1} \mathbf{|} y_{i - 1}$, for $i > 0$. ($\mathbf{|}$ is the bitwise-OR operator)
- $x_0 = 0$ かつ
- $x_i = x_{i - 1} \mathbf{|} y_{i - 1}$ ($i > 0$) ($\mathbf{|}$ はビット論理和演算子)
It can be seen that eventually there will be an index $N$ such that $x_i = 2^{32} - 1$ (a bit-pattern of all ones) for all $i ≥ N$.
すべての $i ≥ N$ について、$x_i = 2^{32} - 1$ (すべてが 1 であるビットパターン) となるような添え字 $N$ が最終的に存在することが分かります。
Find the expected value of $N$. Give your answer rounded to 10 digits after the decimal point.
$N$ の期待値を求めなさい。 回答は、四捨五入して小数第 10 位まで示すこと。
# --hints--
`bitwiseOrOnRandomIntegers()` should return `6.3551758451`.
`bitwiseOrOnRandomIntegers()` `6.3551758451` を返す必要があります。
```js
assert.strictEqual(bitwiseOrOnRandomIntegers(), 6.3551758451);

View File

@ -1,6 +1,6 @@
---
id: 5900f4b11000cf542c50ffc3
title: 'Problem 324: Building a tower'
title: '問題 324: 塔を建設する'
challengeType: 5
forumTopicId: 301981
dashedName: problem-324-building-a-tower
@ -8,17 +8,17 @@ dashedName: problem-324-building-a-tower
# --description--
Let $f(n)$ represent the number of ways one can fill a $3×3×n$ tower with blocks of $2×1×1$. You're allowed to rotate the blocks in any way you like; however, rotations, reflections etc of the tower itself are counted as distinct.
$3×3×n$ の塔を $2×1×1×1$ のブロックで埋める方法が何通りあるかを $f(n)$ で表します。 ブロックは自由に回転させることができますが、塔自体に回転、反転などを加えたものは区別してカウントされます。
For example (with $q = 100\\,000\\,007$):
次に例を示します ($q = 100\\,000\\,007$ の場合)。
$$\begin{align} & f(2) = 229, \\\\ & f(4) = 117\\,805, \\\\ & f(10)\bmod q = 96\\,149\\,360, \\\\ & f({10}^3)\bmod q = 24\\,806\\,056, \\\\ & f({10}^6)\bmod q = 30\\,808\\,124. \end{align}$$
Find $f({10}^{10000})\bmod 100\\,000\\,007$.
$f({10}^{10000})\bmod 100\\,000\\,007$ を求めなさい。
# --hints--
`buildingTower()` should return `96972774`.
`buildingTower()` `96972774` を返す必要があります。
```js
assert.strictEqual(buildingTower(), 96972774);

View File

@ -1,6 +1,6 @@
---
id: 5900f4b11000cf542c50ffc4
title: 'Problem 325: Stone Game II'
title: '問題 325: 石取りゲーム (2)'
challengeType: 5
forumTopicId: 301982
dashedName: problem-325-stone-game-ii
@ -8,23 +8,23 @@ dashedName: problem-325-stone-game-ii
# --description--
A game is played with two piles of stones and two players. On each player's turn, the player may remove a number of stones from the larger pile. The number of stones removes must be a positive multiple of the number of stones in the smaller pile.
石を積み上げた 2 つの山と 2 人のプレイヤーでゲームをします。 各プレイヤーは自分のターンで、大きい山から石をいくつか取ります。 取る石の数は、小さい山にある石の数の正の倍数でなければなりません。
E.g., let the ordered pair (6,14) describe a configuration with 6 stones in the smaller pile and 14 stones in the larger pile, then the first player can remove 6 or 12 stones from the larger pile.
例えば、小さい山に 6 個、大きい山に 14 個の石がある構成を順序対 (6,14) で表すと、先手は大きい山から 6 個または 12 個の石を取ることができます。
The player taking all the stones from a pile wins the game.
1 つの山からすべての石を取ったプレイヤーの勝ちです。
A winning configuration is one where the first player can force a win. For example, (1,5), (2,6) and (3,12) are winning configurations because the first player can immediately remove all stones in the second pile.
勝利構成とは、先手が必ず勝てる構成です。 例えば、(1,5), (2,6), (3,12) は、先手が即座に 2 つ目の山からすべての石を取れるので、勝利構成です。
A losing configuration is one where the second player can force a win, no matter what the first player does. For example, (2,3) and (3,4) are losing configurations: any legal move leaves a winning configuration for the second player.
敗北構成とは、先手が何をしようと後手が必ず勝てる構成です。 例えば、(2,3) (3,4) は敗北構成です。ルールに従う限り、何をしても後手の勝利構成になります。
Define $S(N)$ as the sum of ($x_i + y_i$) for all losing configurations ($x_i$, $y_i$), $0 &lt; x_i &lt; y_i ≤ N$. We can verify that $S(10) = 211$ and $S({10}^4) = 230\\,312\\,207\\,313$.
$0 &lt; x_i &lt; y_i N$ のとき、すべての敗北構成 ($x_i$, $y_i$) に対する ($x_i + y_i$) の和を、$S(N)$ とします。 $S(10) = 211$, $S({10}^4) = 230\\,312\\,207\\,313$ であることを確認できます。
Find $S({10}^{16})\bmod 7^{10}$.
$S({10}^{16})\bmod 7^{10}$ を求めなさい。
# --hints--
`stoneGameTwo()` should return `54672965`.
`stoneGameTwo()` `54672965` を返す必要があります。
```js
assert.strictEqual(stoneGameTwo(), 54672965);

View File

@ -1,6 +1,6 @@
---
id: 5900f4b21000cf542c50ffc5
title: 'Problem 326: Modulo Summations'
title: '問題 326: 剰余の総和 (Modulo Summation)'
challengeType: 5
forumTopicId: 301983
dashedName: problem-326-modulo-summations
@ -8,23 +8,23 @@ dashedName: problem-326-modulo-summations
# --description--
Let an be a sequence recursively defined by: $a_1 = 1$, $\displaystyle a_n = \left(\sum_{k = 1}^{n - 1} k \times a_k\right)\bmod n$.
$a_1 = 1$, $\displaystyle a_n = \left(\sum_{k = 1}^{n - 1} k \times a_k\right)\bmod n$ によって再帰的に定義される数列を $a_n$ とします。
So the first 10 elements of $a_n$ are: 1, 1, 0, 3, 0, 3, 5, 4, 1, 9.
したがって、$a_n$ の最初の 10 項は 1, 1, 0, 3, 0, 3, 5, 4, 1, 9 です。
Let $f(N, M)$ represent the number of pairs $(p, q)$ such that:
次の条件を満たす対 $(p, q)$ の個数を $f(N, M)$ とします。
$$ 1 \le p \le q \le N \\; \text{and} \\; \left(\sum_{i = p}^q a_i\right)\bmod M = 0$$
$$ 1 \le p \le q \le N \\; \text{かつ} \\; \left(\sum_{i = p}^q a_i\right)\bmod M = 0$$
It can be seen that $f(10, 10) = 4$ with the pairs (3,3), (5,5), (7,9) and (9,10).
$f(10, 10) = 4 であることが分かります。(3,3), (5,5), (7,9), (9,10) の 4 対です。
You are also given that $f({10}^4, {10}^3) = 97\\,158$.
さらに、$f({10}^4, {10}^3) = 97\\,158$ が与えられます。
Find $f({10}^{12}, {10}^6)$.
$f({10}^{12}, {10}^6)$ を求めなさい。
# --hints--
`moduloSummations()` should return `1966666166408794400`.
`moduloSummations()` `1966666166408794400` を返す必要があります。
```js
assert.strictEqual(moduloSummations(), 1966666166408794400);

View File

@ -1,6 +1,6 @@
---
id: 5900f4b31000cf542c50ffc6
title: 'Problem 327: Rooms of Doom'
title: '問題 327: 運命の部屋'
challengeType: 5
forumTopicId: 301984
dashedName: problem-327-rooms-of-doom
@ -8,35 +8,35 @@ dashedName: problem-327-rooms-of-doom
# --description--
A series of three rooms are connected to each other by automatic doors.
連続する 3 つの部屋が自動ドアでつながっています。
<img class="img-responsive center-block" alt="series of three rooms, connected to each other by automatic doors" src="https://cdn.freecodecamp.org/curriculum/project-euler/rooms-of-doom.gif" style="background-color: white; padding: 10px;" />
<img class="img-responsive center-block" alt="自動ドアでつながった連続する 3 部屋" src="https://cdn.freecodecamp.org/curriculum/project-euler/rooms-of-doom.gif" style="background-color: white; padding: 10px;" />
Each door is operated by a security card. Once you enter a room, the door automatically closes, and that security card cannot be used again. A machine will dispense an unlimited number of cards at the start, but each room (including the starting room) contains scanners. If they detect that you are holding more than three security cards or if they detect an unattended security card on the floor, then all the doors will become permanently locked. However, each room contains a box where you may safely store any number of security cards for use at a later stage.
各ドアを開けるにはセキュリティカードを使います。 部屋に入るとドアが自動的に閉まり、そのセキュリティカードは二度と使えません。 開始時、カード発行機から何枚でもカードを入手できますが、各部屋 (開始点となる部屋を含む) には検出器が設置されています。 あなたが 3 枚以上のセキュリティカードを持っていることや、セキュリティカードが床に放置されていることが検出されると、すべてのドアが永久にロックされます。 ただし、各部屋には箱があり、後で使うための任意の枚数のセキュリティカードをその箱に安全に保管できます。
If you simply tried to travel through the rooms one at a time then as you entered room 3 you would have used all three cards and would be trapped in that room forever!
単に部屋を一度に通り抜けようとすると、3 つ目の部屋に入った時には 3 枚のカードを使い切っているので、永久にその部屋に閉じ込められます!
However, if you make use of the storage boxes, then escape is possible. For example, you could enter room 1 using your first card, place one card in the storage box, and use your third card to exit the room back to the start. Then after collecting three more cards from the dispensing machine you could use one to enter room 1 and collect the card you placed in the box a moment ago. You now have three cards again and will be able to travel through the remaining three doors. This method allows you to travel through all three rooms using six security cards in total.
しかし、保管箱を使えば 脱出できる可能性があります。 例えば、1 枚目のカードを使って 1 つ目の部屋に入り、保管箱にカードを 1 枚入れ、3 枚目のカードを使って開始地点に戻ります。 その後、さらに 3 枚のカードを発行機から入手し、1 枚を使って 1 つ目の部屋に入り、先ほど箱に入れたカードを取り出します。 再び 3 枚のカードを持っているので、残りの 3 つのドアを通過することができます。 この方法なら、計 6 枚のセキュリティカードを使って 3 つの部屋を通り抜けられます。
It is possible to travel through six rooms using a total of 123 security cards while carrying a maximum of 3 cards.
一度に最大 3 枚のカードを持ち、計 123 枚のセキュリティカードを使って 6 つの部屋を通り抜けることができます。
Let $C$ be the maximum number of cards which can be carried at any time.
どの時点であれ一度に持つことができるカードの最大枚数を、$C$ とします。
Let $R$ be the number of rooms to travel through.
通り抜ける部屋の数を $R$ とします。
Let $M(C, R)$ be the minimum number of cards required from the dispensing machine to travel through $R$ rooms carrying up to a maximum of $C$ cards at any time.
どの時点であれ一度に最大 $C$ 枚のカードを持ち、$R$ 個の部屋を通り抜けるために発行機から入手する必要のあるカードの最小枚数を $M(C, R)$ とします。
For example, $M(3, 6) = 123$ and $M(4, 6) = 23$.
例えば、$M(3, 6) = 123$, $M(4, 6) = 23$ です。
And, $\sum M(C, 6) = 146$ for $3 ≤ C ≤ 4$.
また、$3 ≤ C ≤ 4$ のとき、$\sum M(C, 6) = 146$ です。
You are given that $\sum M(C, 10) = 10382$ for $3 ≤ C ≤ 10$.
$3 ≤ C ≤ 10$ のとき、$\sum M(C, 10) = 10382$ が与えられます。
Find $\sum M(C, 30)$ for $3 ≤ C ≤ 40$.
$3 ≤ C ≤ 40$ のとき、$\sum M(C, 30)$ を求めなさい。
# --hints--
`roomsOfDoom()` should return `34315549139516`.
`roomsOfDoom()` `34315549139516` を返す必要があります。
```js
assert.strictEqual(roomsOfDoom(), 34315549139516);

View File

@ -1,6 +1,6 @@
---
id: 5900f4b41000cf542c50ffc7
title: 'Problem 328: Lowest-cost Search'
title: '問題 328: 最低コストを探す'
challengeType: 5
forumTopicId: 301985
dashedName: problem-328-lowest-cost-search
@ -8,29 +8,29 @@ dashedName: problem-328-lowest-cost-search
# --description--
We are trying to find a hidden number selected from the set of integers {1, 2, ..., $n$} by asking questions. Each number (question) we ask, has a <u>cost equal to the number asked</u> and we get one of three possible answers:
整数 {1, 2, ..., $n$} から選ばれた秘密の数を、質問をすることで当てます。 それぞれの数 (質問) を尋ねるとき、<u>尋ねた数と同じだけのコスト</u>がかかり、得られる答えは次の 3 つのいずれかです。
- "Your guess is lower than the hidden number", or
- "Yes, that's it!", or
- "Your guess is higher than the hidden number".
- 「あなたの推測は秘密の数よりも小さい」
- 「当たり!」
- 「あなたの推測は秘密の数よりも大きい」
Given the value of $n$, an optimal strategy minimizes the total cost (i.e. the sum of all the questions asked) <u>for the worst possible case</u>. E.g.
値 $n$ が与えられているとき、最適な戦略に従えば、<u>起こり得る最悪のケース</u>の総コスト (すなわち、尋ねた質問の総和) が最小化します。 次に例を示します。
If $n = 3$, the best we can do is obviously to ask the number "<strong>2</strong>". The answer will immediately lead us to find the hidden number (at a total cost = 2).
$n = 3$ の場合、一番良いのはもちろん、秘密の数が "<strong>2</strong>" であるかどうかを尋ねることです。 答えを聞けば、すぐに秘密の数が分かります (総コスト = 2)
If $n = 8$, we might decide to use a "binary search" type of strategy: Our first question would be "<strong>4</strong>" and if the hidden number is higher than 4 we will need one or two additional questions. Let our second question be "<strong>6</strong>". If the hidden number is still higher than 6, we will need a third question in order to discriminate between 7 and 8. Thus, our third question will be "<strong>7</strong>" and the total cost for this worst-case scenario will be $4 + 6 + 7 = \mathbf{\color{red}{17}}$.
$n = 8$ の場合は「二分探索」型の戦略が良いかもしれません。まず "<strong>4</strong>" を尋ね、秘密の数が 4 より大きければ、さらに 1 回か 2 回尋ねる必要があります。 2 回目は "<strong>6</strong>" を尋ねます。 秘密の数が 6 よりさらに大きければ、7 か 8 かを知るために 3 回目の質問が必要です。 したがって、3 回目の質問は "<strong>7</strong>" であり、この最悪ケースの総コストは $4 + 6 + 7 = \mathbf{\color{red}{17}}$です。
We can improve considerably the worst-case cost for $n = 8$, by asking "<strong>5</strong>" as our first question. If we are told that the hidden number is higher than 5, our second question will be "<strong>7</strong>", then we'll know for certain what the hidden number is (for a total cost of $5 + 7 = \mathbf{\color{blue}{12}}$). If we are told that the hidden number is lower than 5, our second question will be "<strong>3</strong>" and if the hidden number is lower than 3 our third question will be "<strong>1</strong>", giving a total cost of $5 + 3 + 1 = \mathbf{\color{blue}{9}}$. Since $\mathbf{\color{blue}{12 > 9}}$, the worst-case cost for this strategy is <strong><span style="color: red;">12</span></strong>. That's better than what we achieved previously with the "binary search" strategy; it is also better than or equal to any other strategy. So, in fact, we have just described an optimal strategy for $n = 8$.
1 回目の質問で "<strong>5</strong>" を尋ねれば、$n=8$ に対する最悪ケースのコストを大幅に下げることができます。 秘密の数が 5 よりも大きいと言われた場合、2 回目の質問は「<strong>7</strong>」となり、秘密の数がどれなのかを確実に知ることができます (総コスト $5 + 7 = \mathbf{\color{blue}{12}}$)。 秘密の数が 5 よりも小きいと言われた場合、2 回目の質問は「<strong>3</strong>」となり、秘密の数が 3 より小さければ、3 回目の質問は "<strong>1</strong>" であり、総コストは $5 + 3 + 1 = \mathbf{\color{blue}{9}}$ です。 $\mathbf{\color{blue}{12 > 9}}$ なので、この戦略における最悪ケースのコストは <strong><span style="color: red;">12</span></strong> です。 これは、先ほどの「二分探索」戦略の結果よりも優れています。また、他のどの戦略よりも優れているか、少なくとも同等です。 さて、ここまで $n = 8$ の最適な戦略を説明してきました。
Let $C(n)$ be the worst-case cost achieved by an optimal strategy for $n$, as described above. Thus $C(1) = 0$, $C(2) = 1$, $C(3) = 2$ and $C(8) = 12$.
上のとおり、$n$ に対する最適な戦略によって達成される、最悪ケースのコストを $C(n)$ とします。 したがって、$C(1) = 0$, $C(2) = 1$, $C(3) = 2$, $C(8) = 12$ です。
Similarly, $C(100) = 400$ and $\displaystyle\sum_{n = 1}^{100} C(n) = 17575$.
同様に、$C(100) = 400$, $\displaystyle\sum_{n = 1}^{100} C(n) = 17575$ です。
Find $\displaystyle\sum_{n = 1}^{200\\,000} C(n)$.
$\displaystyle\sum_{n = 1}^{200\\,000} C(n)$ を求めなさい。
# --hints--
`lowestCostSearch()` should return `260511850222`.
`lowestCostSearch()` `260511850222` を返す必要があります。
```js
assert.strictEqual(lowestCostSearch(), 260511850222);

View File

@ -1,6 +1,6 @@
---
id: 5900f4b51000cf542c50ffc8
title: 'Problem 329: Prime Frog'
title: '問題 329: 素数ガエル'
challengeType: 5
forumTopicId: 301986
dashedName: problem-329-prime-frog
@ -8,27 +8,27 @@ dashedName: problem-329-prime-frog
# --description--
Susan has a prime frog.
スーザンは素数ガエルを飼っています。
Her frog is jumping around over 500 squares numbered 1 to 500.
そのカエルは、1 から 500 までの番号が振られた 500 個のマスの上を跳び回ります。
He can only jump one square to the left or to the right, with equal probability, and he cannot jump outside the range [1;500]. (if it lands at either end, it automatically jumps to the only available square on the next move.)
左または右のマスのみへ等しい確率で跳ぶことができ、範囲 [1;500] の外側に跳ぶことはできません。 (いずれかの端に着くと、次に移動できる唯一のマスへ自動的に跳びます。)
When he is on a square with a prime number on it, he croaks 'P' (PRIME) with probability $\frac{2}{3}$ or 'N' (NOT PRIME) with probability $\frac{1}{3}$ just before jumping to the next square. When he is on a square with a number on it that is not a prime he croaks 'P' with probability $\frac{1}{3}$ or 'N' with probability $\frac{2}{3}$ just before jumping to the next square.
素数が書かれたマスにいるとき、次のマスへ跳ぶ直前に、確率 $\frac{2}{3}$ 'P' (素数)、または確率 $\frac{1}{3}$ で 'N' (非素数) と鳴きます。 非素数が書かれたマスにいるとき、次のマスへ跳ぶ直前に、確率 $\frac{1}{3}$ 'P' と鳴くか、確率 $\frac{2}{3}$ で 'N' と鳴きます。
Given that the frog's starting position is random with the same probability for every square, and given that she listens to his first 15 croaks, what is the probability that she hears the sequence PPPPNNPPPNPPNPN?
カエルがどのマスから跳び始めるかは、不規則かつすべてのマスで等確率であるとします。カエルの最初の 15 回の鳴き声が PPPPNNPPPNPPNPN の順になる確率を求めなさい。
Give your answer as a string as a fraction `p/q` in reduced form.
回答は、既約分数 `p/q` の形式の文字列にすること。
# --hints--
`primeFrog()` should return a string.
`primeFrog()` は文字列を返す必要があります。
```js
assert(typeof primeFrog() === 'string');
```
`primeFrog()` should return the string `199740353/29386561536000`.
`primeFrog()` は文字列 `199740353/29386561536000` を返す必要があります。
```js
assert.strictEqual(primeFrog(), '199740353/29386561536000');

View File

@ -1,6 +1,6 @@
---
id: 5900f4b71000cf542c50ffc9
title: 'Problem 330: Euler''s Number'
title: '問題 330: オイラー数'
challengeType: 5
forumTopicId: 301988
dashedName: problem-330-eulers-number
@ -8,25 +8,25 @@ dashedName: problem-330-eulers-number
# --description--
An infinite sequence of real numbers $a(n)$ is defined for all integers $n$ as follows:
すべての整数 $n$ について、実数の無限数列 $a(n)$ は次のように定義されます。
$$ a(n) = \begin{cases} 1 & n < 0 \\\\ \displaystyle \sum_{i = 1}^{\infty} \frac{a(n - 1)}{i!} & n \ge 0 \end{cases} $$
For example,
例えば次のようになります
$$\begin{align} & a(0) = \frac{1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \ldots = e 1 \\\\ & a(1) = \frac{e 1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \ldots = 2e 3 \\\\ & a(2) = \frac{2e 3}{1!} + \frac{e 1}{2!} + \frac{1}{3!} + \ldots = \frac{7}{2} e 6 \end{align}$$
with $e = 2.7182818\ldots$ being Euler's constant.
ここで$e = 2.7182818\ldots$ はオイラーの定数です
It can be shown that $a(n)$ is of the form $\displaystyle\frac{A(n)e + B(n)}{n!}$ for integers $A(n)$ and $B(n)$.
$a(n)$ 整数 $A(n)$ と整数 $B(n)$ に対して $\displaystyle\frac{A(n)e + B(n)}{n!}$ の形式であることが分かります
For example $\displaystyle a(10) = \frac{328161643e 652694486}{10!}$.
例えば$\displaystyle a(10) = \frac{328161643e 652694486}{10!}$ です
Find $A({10}^9)$ + $B({10}^9)$ and give your answer $\bmod 77\\,777\\,777$.
$A({10}^9)$ + $B({10}^9)$ を求め$\bmod 77\\,777\\,777$ で答えなさい
# --hints--
`eulersNumber()` should return `15955822`.
`eulersNumber()` `15955822` を返す必要があります
```js
assert.strictEqual(eulersNumber(), 15955822);

Some files were not shown because too many files have changed in this diff Show More