XXI Open Cup named after E.V. Pankratiev. Grand Prix of Korea

C

知道这个定理:

Theorem. A graph \(G\) is strongly connected if and only if it can be constructed using the following procedure:

  1. Start with \(N\) isolated vertices. Pick any vertex \(v\), and let \(S = \{v\}\).
  2. 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?

XXI Open Cup named after E.V. Pankratiev. Grand Prix of Korea

上一篇:字符串长度获取与截取


下一篇:68. 文本左右对齐