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 \(u\in S\). The two vertices can be the same.
(b) Pick zero or more distinct vertices \(w_1, \cdots, w_k \notin S\).
(c) Connect \(v\rightarrow w_1 \rightarrow \cdots \rightarrow w_k \rightarrow u\), and put \(w_1 \cdots w_k\) into \(S\).
然后就可以 xjb 状压 dp 了,题解给的第四维可以省掉
G
dp of dp, TODO: bzoj ATGC LCS by clj?