Tarjan 求强连通分量 展开查看 #include #include #include using namespace std; const int N = 1e4 + 1e3; int n, m, cnt, dfn[N], low[N], inq[N]; int stk[N], tp, c[N], cnt_c, sz[N]; vector ed[N], ed_c[N]; void tarjan(int u) { inq[u] = 1; stk[++tp] = u; dfn[u] = low…