1 int dfn[maxn]; 2 int low[maxn]; 3 bool cut[maxn]; 4 int tot; 5 6 void tarjan(int x) 7 { 8 dfn[x] = low[x] = ++tot; 9 int cntf = 0; 10 for (Re int i = head[x]; i != -1; i = e[i].nxt) 11 { 12 int u = e[i].u; 13 if (!dfn[u]) 14 { 15 tarjan(u); 16 low[x] = min(low[x], low[u]); 17 if (low[u] >= dfn[x]) 18 { 19 cntf++; 20 if (x > 1 || cntf > 1) cut[x] = true; 21 } 22 } 23 else low[x] = min(low[x], dfn[u]); 24 } 25 }