Unverified Commit 804b129a authored by shaochenheng's avatar shaochenheng Committed by GitHub
Browse files

Update docs/graph/steiner-tree.md

parent dafffe1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@

可以发现状态转移与上面的模板题是类似的,麻烦的是对答案的输出,在 DP 的过程中还要记录路径。

用 pre[i][s]记录转移到 $i$ 为根,连通状态集合为 $s$ 时的点与集合的信息。在 DP 结束后从 pre[root][S]出发,寻找与集合里的点相连的那些点并逐步分解集合 $S$ ,用 ans 数组来记录被使用的那些点,当集合分解完毕时搜索也就结束了。
`pre[i][s]` 记录转移到 $i$ 为根,连通状态集合为 $s$ 时的点与集合的信息。在 DP 结束后从 `pre[root][S]` 出发,寻找与集合里的点相连的那些点并逐步分解集合 $S$ ,用 ans 数组来记录被使用的那些点,当集合分解完毕时搜索也就结束了。

??? note "参考实现"
    ```c++