Trajan

xiaoxiao2025-11-01  51

void dfs(int x) { inst[x]=1; st.push(x); dfn[x]=low[x]=++Time; for(int t=las[x];t;t=nn[t]) { int y=e[t]; if(!dfn[y])dfs(y),low[x]=min(low[x],low[y]); else if(inst[y])low[x]=min(low[x],dfn[y]); } if(dfn[x]==low[x]) { int now; ++scc; do{ now=st.top(); st.pop(); inst[now]=0; ... }while(now!=x); } }
转载请注明原文地址: https://www.6miu.com/read-5038878.html

最新回复(0)