Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Articulation Point
#include<bits/stdc++.h> using namespace std; #define ll long long int const int N=1e6; vector<ll> v[N],tin(N),low(N); vector<pair<ll,ll> > ans; map<ll,ll> S; ll vis[N+1],timer=0; void dfs(ll s,ll p) { vis[s]=1; tin[s]=timer; low[s]=timer; timer++; for(auto des : v[s]) { if(des==p) continue; if(vis[des]) {if(S.find({des,s})==S.end()) cout<<s<<" "<<des<<endl; low[s]=min(low[s],tin[des]),S.insert({s,des});} else { if(S.find({des,s})==S.end()) cout<<s<<" "<<des<<endl; dfs(des,s); low[s]=min(low[s],low[des]); if(low[des]>tin[s]) cout<<des<<" "<<s<<endl; S.insert({s,des});S.insert({des,s}); } } }
run
|
edit
|
history
|
help
0
BreakfastMenu array
kadane's algorithm 2
dia
TraceMarrix
dsu on tree (http://codeforces.com/contest/208/problem/E)
D.E.Shaw Binary Search Question
ThreeVariableRegression
Facebook - Split into monotonic sequences
cvcvcvcvv
Translating binary to decimal numbers