mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-01 18:14:25 +00:00
Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4 * Retranslate Japanese code with GPT-5.4
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
|
||||
#include "../utils/common.hpp"
|
||||
|
||||
/* 探索 */
|
||||
/* 検索 */
|
||||
int dfs(int i) {
|
||||
// 既知の dp[1] と dp[2] を返す
|
||||
// dp[1] と dp[2] は既知なので返す
|
||||
if (i == 1 || i == 2)
|
||||
return i;
|
||||
// dp[i] = dp[i-1] + dp[i-2]
|
||||
@@ -21,12 +21,12 @@ int climbingStairsDFS(int n) {
|
||||
return dfs(n);
|
||||
}
|
||||
|
||||
/* ドライバーコード */
|
||||
/* Driver Code */
|
||||
int main() {
|
||||
int n = 9;
|
||||
|
||||
int res = climbingStairsDFS(n);
|
||||
cout << n << "段の階段を登る解は" << res << "通りです" << endl;
|
||||
cout << "階段を " << n << " 段上る方法は全部で " << res << " 通り" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user