From 64dab92206760b0d684033ce7d80e6b77eea2aed Mon Sep 17 00:00:00 2001 From: ouuan Date: Thu, 22 Aug 2019 21:05:25 +0800 Subject: [PATCH] $\,\qquad$ --- docs/intro/htc.md | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/docs/intro/htc.md b/docs/intro/htc.md index 619aa1a8..f2aba582 100644 --- a/docs/intro/htc.md +++ b/docs/intro/htc.md @@ -159,7 +159,11 @@ LaTeX 作为公式排版的首选,我们应当正确地使用它。因此对 伪码具体格式没有严格要求,请参考算法导论或学术论文。注意不要写成 Python,赋值使用 `$\gets$` 表示。 -在 Wiki 中,使用 Markdown 引用来书写伪代码,使用 `$\qquad$` 表示缩进。 +在 Wiki 中,使用 Markdown 引用来书写伪代码。 + +不缩进:`> $\,$ your codes`。 + +两层缩进:`> $\,\qquad\qquad$ $x\gets 0$`。 例如: @@ -169,40 +173,40 @@ LaTeX 作为公式排版的首选,我们应当正确地使用它。因此对 > > **Method.** > -> $result \gets \varnothing$ +> $\,$ $result \gets \varnothing$ > -> sort $e$ into nondecreasing order by weight $w$ +> $\,$ sort $e$ into nondecreasing order by weight $w$ > -> **for** each $(u, v, w)$ in the sorted $e$ +> $\,$ **for** each $(u, v, w)$ in the sorted $e$ > -> $\qquad$ **if** $u$ and $v$ are not connected in the union-find set +> $\,\qquad$ **if** $u$ and $v$ are not connected in the union-find set > -> $\qquad\qquad$ connect $u$ and $v$ in the union-find set +> $\,\qquad\qquad$ connect $u$ and $v$ in the union-find set > -> $\qquad\qquad result \gets result\ \bigcup\ \{(u, v, w)\}$ +> $\,\qquad\qquad$ $result \gets result\ \bigcup\ \{(u, v, w)\}$ > -> **return** $result$ +> $\,$ **return** $result$ ```markdown -> **Input.** The edges of the graph $e$, where each element in $e$ is $(u, v, w)$ denoting that there is an edge between $u$ and $v$ weighted $w$. +> **Input.** The edges of the graph $e$ , where each element in $e$ is $(u, v, w)$ denoting that there is an edge between $u$ and $v$ weighted $w$ . > -> **Output.** The edges of the MST of the input graph. +> **Output.** The edges of the MST of the input graph. > -> **Method.** +> **Method.** > -> $result \gets \varnothing$ +> $\,$ $result \gets \varnothing$ > -> sort $e$ into nondecreasing order by weight $w$ +> $\,$ sort $e$ into nondecreasing order by weight $w$ > -> **for** each $(u, v, w)$ in the sorted $e$ +> $\,$ **for** each $(u, v, w)$ in the sorted $e$ > -> $\qquad$**if** $u$ and $v$ are not connected in the union-find set +> $\,\qquad$ **if** $u$ and $v$ are not connected in the union-find set > -> $\qquad\qquad$connect $u$ and $v$ in the union-find set +> $\,\qquad\qquad$ connect $u$ and $v$ in the union-find set > -> $\qquad\qquad result \gets result\ \bigcup\ \{(u, v, w)\}$ +> $\,\qquad\qquad$ $result \gets result\ \bigcup\ \{(u, v, w)\}$ > -> **return** $result$ +> $\,$ **return** $result$ ``` ## 图解 -- 2.11.0