Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. int num[10005],low[10005],art[10005];
  2. vector<int> e[10005];
  3. int ptr=1;
  4. void findart(int u,int p=0){
  5.     num[u]=low[u]=ptr++;
  6.     int cnt=0;
  7.     for(auto v:e[u]){
  8.         if(num[v]==0){
  9.             findart(v,u);
  10.             low[u]=min(low[u],low[v]);
  11.             cnt++;
  12.             if(p==0&&cnt>1)art[u]=1;
  13.             if(p!=0&&low[v]>=num[u])art[u]=1;
  14.         }
  15.         else if(v!=p)low[u]=min(num[v],low[u]);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement