I do not want the face of the direct Amway ATP Big Man's blog (forgive me the old yz habit of the girls called the Big Guy)
Put some ban (suddenly think of a pesticide) son.
intz,dfn[110000],low[110000];inttop,sta[110000];BOOLv[110000];intcnt,belong[110000];voidStrong_unicom (intx) {Dfn[x]=low[x]++Z; sta[++top]=x;v[x]=true; for(intk=last[x];k;k=A[k].next) { inty=a[k].y; if(dfn[y]==0) {strong_unicom (y); LOW[X]=min (low[x],low[y]); } Else { if(v[y]==true) Low[x]=min (low[x],dfn[y]); } } if(dfn[x]==Low[x]) { inti;cnt++; Do{i=sta[top];top--; V[i]=false; Belong[i]=CNT; } while(i!=x); }}//----------------function--------------------Z=top=cnt=0; memset (DFN,0,sizeof(DFN)); memset (Low,0,sizeof(low)); memset (V,false,sizeof(v)); for(intI=1; i<=n;i++) if(dfn[i]==0) strong_unicom (i);//------------------Main-------------------the strong unicom of the base (is also posing)
Once we all had a problem.
Low[x]=min (Low[x],dfn[y]); Change to Low[x]=min (Low[x],low[y]);
Can also AC, now understand, is to emphasize the meaning of cutting point.
intz,dfn[110000],low[110000],cut[110000];voidFindcut (intx) {Dfn[x]=low[x]=++Z; for(intk=last[x];k;k=A[k].next) { inty=a[k].y; if(dfn[y]==0) {findcut (y); LOW[X]=min (low[x],low[y]); if(Low[y]>=dfn[x]) cut[x]++; } Elselow[x]=min (low[x],dfn[y]); }}//----------------function--------------------z=0; memset (DFN,0,sizeof(DFN)); memset (Low,0,sizeof(low)); memset (Cut,0,sizeof(cut)); for(intI=1; i<=n;i++) if(dfn[i]==0) findcut (i); Elsecut[i]++;//------------------Main-------------------number of cut points for a point to be connected (bzoj2730 mine construction)
Strong Unicom Tarjan Some of the black technology and random thoughts