标签:lan problem class strong int oid block cat code
//Tarjan
int ic,in[N+7],low[N+7],dfn[N+7],sc,st[N+7],cc,co[N+7],sm[N+7];
void Tarjan(int u){
low[u]=dfn[u]=++ic,in[u]=1,st[++sc]=u;
for(int v:e[u])
if(!dfn[v]) Tarjan(v),low[u]=min(low[u],low[v]);
else if(in[v]) low[u]=min(low[u],dfn[v]);
if(dfn[u]==low[u]) for(int v=0,t=++cc;v!=u;) v=st[sc--],co[v]=t,in[v]=0,sm[t]++;
}
标签:lan problem class strong int oid block cat code
原文地址:https://www.cnblogs.com/Wendigo/p/12916494.html