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);
}
}