C
知道这个定理:
Theorem. A graph (G) is strongly connected if and only if it can be constructed using the following procedure:
- Start with (N) isolated vertices. Pick any vertex (v), and let (S = {v}).
- Repeat the following until (S = V(G)):
(a) Pick two vertices (v) and (uin S). The two vertices can be the same.
(b) Pick zero or more distinct vertices (w_1, cdots, w_k otin S).
(c) Connect (v ightarrow w_1 ightarrow cdots ightarrow w_k ightarrow u), and put (w_1 cdots w_k) into (S).
然后就可以 xjb 状压 dp 了,题解给的第四维可以省掉
G
dp of dp, TODO: bzoj ATGC LCS by clj?