标签:tar class sharp oid else ack for false bsp
void tarjan(int u){ dfn[u]=low[u]=++num; stack[++top]=u; instack[u]=true; for(int i=hd[u];i;i=bl[i].nt){ if(!dfn[bl[i].to]){ tarjan(bl[i].to); low[u]=minn(low[u],low[bl[i].to]); } else if(instack[bl[i].to]) low[u]=minn(low[u],dfn[bl[i].to]); } if(dfn[u]==low[u]){ int tan=stack[top]; ++tot; while(tan!=u){ belong[tan]=tot; instack[tan]=false; tan=stack[--top]; } belong[tan]=tot; instack[tan]=false; } }
标签:tar class sharp oid else ack for false bsp
原文地址:https://www.cnblogs.com/2018hzoicyf/p/11327123.html