题解:P14362 [CSP-S 2025] 道路修复 / road

· · 题解

得到 O(nk2^k) 做法后,可以简单拓展的 O(n2^k)。

对每个 $msk=S\cup\set{x}$ 令 $x$ 为 $\mathrm{lowbit}$ 即可。