Sakuya_maid @ 2023-10-04 15:20:59
如题,所以不能
low[u] = dfsn[u] = ++ timestamp;
stk.push(u);
in_stk[u] = true;
for(int i = h[u]; ~i; i = ne[i])
{
int v = e[i];
if(v == f)continue;//different
if(!dfsn[v])
{
tarjan(v, u);//different
low[u] = min(low[u], low[v]);
if(dfsn[u] < low[v])
{
is_bridge[i] = is_bridge[i ^ 1] = true;
}
}
else if(in_stk[v])//different
low[u] = min(low[u], dfsn[v]);
}
只能如下吗
low[u] = dfsn[u] = ++ timestamp;
stk.push(u);
in_stk[u] = true;
for(int i = h[u]; ~i; i = ne[i])
{
int v = e[i];
// if(v == f)continue;//different
if(!dfsn[v])
{
tarjan(v, i);//different
low[u] = min(low[u], low[v]);
if(dfsn[u] < low[v])
{
is_bridge[i] = is_bridge[i ^ 1] = true;
}
}
else if(i != (f ^ 1))//different
low[u] = min(low[u], dfsn[v]);
}