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?

上一篇:字符串拼接还在用StringBuilder?快试试Java8中的StringJoiner吧,真香!


下一篇:2021SC@SDUSC山东大学软件学院软件工程应用与实践--Ebiten代码分析 源码分析(五)