标签:lse false tap void lang min tar bre lan
void tarjan(int u) {
int v;
dfn[u] = low[u] = ++in;
instack[u] = true;
Stap[++stop] = u;
for (int i = head[u]; i; i = eg[i].nex) {
v = eg[i].to;
if (!dfn[v]) {
tarjan(v);
low[u] = min(low[v], low[u]);
}
else if (instack[v])
low[u] = min(low[u], dfn[v]);
}
if (dfn[u] == low[u]) {
++Bcnt;
while (true) {
v = Stap[stop--];
instack[v] = false;
belong[v] = Bcnt;
all[Bcnt]++;
if (v == u)break;
}
}
}
标签:lse false tap void lang min tar bre lan
原文地址:https://www.cnblogs.com/JihuiPeng/p/13662417.html