Retranslate the complete Japanese online edition from Chinese (#2008)

* Retranslate the complete Japanese online edition from Chinese

* Fit Japanese homepage labels and localize heading permalinks

* Point Japanese contribution instructions to the Japanese preview

* Replace locale conditionals with multilingual UI tables
This commit is contained in:
Yudong Jin
2026-10-30 02:12:26 +08:00
committed by GitHub
parent 455e8c1281
commit 7257641e0e
1987 changed files with 23531 additions and 23261 deletions
@@ -6,40 +6,40 @@
#include "../utils/common.hpp"
/* 円盤を 1 枚移動 */
/* 円盤を 1 枚移動する */
void move(vector<int> &src, vector<int> &tar) {
// src の上から円盤を1枚取り出す
// src の一番上から円盤を 1 枚取り出す
int pan = src.back();
src.pop_back();
// 円盤を tar の上に置く
// tar の一番上に円盤を置く
tar.push_back(pan);
}
/* ハノイの塔の問題 f(i) を解く */
void dfs(int i, vector<int> &src, vector<int> &buf, vector<int> &tar) {
// src に円盤が 1 枚だけ残っている場合は、そのまま tar へ移す
// src に円盤が 1 枚だけ残っている場合、そのまま tar に移す
if (i == 1) {
move(src, tar);
return;
}
// 部分問題 f(i-1):src の上部 i-1 枚の円盤を tar を補助にして buf へ移す
// 部分問題 f(i-1) :src の上から i-1 枚の円盤を、tar を使って buf に移す
dfs(i - 1, src, tar, buf);
// 部分問題 f(1):src に残る 1 枚の円盤を tar に移す
// 部分問題 f(1) :src に残った 1 枚の円盤を tar に移す
move(src, tar);
// 部分問題 f(i-1):buf の上部 i-1 枚の円盤を src を補助にして tar へ移す
// 部分問題 f(i-1) :buf の上から i-1 枚の円盤を、src を使って tar に移す
dfs(i - 1, buf, src, tar);
}
/* ハノイの塔を解く */
/* ハノイの塔の問題を解く */
void solveHanota(vector<int> &A, vector<int> &B, vector<int> &C) {
int n = A.size();
// A の上から n 枚の円盤を B を介して C へ移す
// A の上から n 枚の円盤を、B を使って C に移す
dfs(n, A, B, C);
}
/* Driver Code */
/* 実行用コード */
int main() {
// リスト末尾が柱の頂上
// リストの末尾が棒の一番上に対応する
vector<int> A = {5, 4, 3, 2, 1};
vector<int> B = {};
vector<int> C = {};