Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void dfs_bridge (int v, int p)
- {
- times++;
- t[v] = times;
- dp[v] = times;
- used[v] = 1;
- for (int i = 0; i < g[v].size(); i++)
- {
- int to = g[v][i];
- if (to != p && used[to])
- dp[v] = min(dp[v], t[to]);
- if (!used[to])
- {
- dfs_bridge(to, v);
- dp[v] = min(dp[v], dp[to]);
- }
- }
- if (dp[v] == t[v] && p != -1)
- ans.push_back(make_pair(min(p, v), max(p, v) ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement