Morass

BB

Sep 20th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #define AC (g[u][i])
  2. void dfs(int u){
  3.     cn[u]=1,h++,e[u]=d[u]=h;
  4.     F((ll)g[u].size())
  5.         if(!cn[AC])
  6.             dfs(AC),D+=u==r,A[r]=D>=2,e[u]=min(e[u],e[AC]),A[u]|=e[AC]>=d[u]&&u!=r;
  7.         else e[u]=min(e[u],d[AC]);
  8. }
  9. #define CLR F(n+1)g[i].clear(),e[i]=d[i]=cn[i]=A[i]=0;h=D=0;
  10. #define CAL (dfs(r=1))
Advertisement
Add Comment
Please, Sign In to add comment