procedureDFS(s:byte); var i:byte; begin if vis[s] then exit; vis[s]:=true; for i:=1to m do begin inc(cx[i],con[s,i]); if cx[i]>50then begin own[i]:=true; DFS(i); end; end; end;
proceduredfs1(x,y:integer); var i,j:integer; begin if b[x]=false thenexit; b[x]:=false; if x<>y then begin for i:=1to a[x].next do if (a[x].jie[i]=y) then begin a[x].flag[a[x].jie[i]]:=true; end; for i:=1to a[x].next do begin for j:=1to a[y].next do if (a[y].jie[j]=a[x].jie[i])and(not a[x].flag[i]) then begin a[y].jdata[j]:=a[x].jdata[i]+a[y].jdata[j]; a[x].flag[i]:=true; end; end; for i:=1to a[x].next do if (not a[x].flag[i])and(a[x].jie[i]<>y)then begin inc(a[y].next); a[y].jie[a[y].next]:=a[x].jie[i]; a[y].jdata[a[y].next]:=a[x].jdata[i]; end; end; for i:=1to a[x].next do begin if (a[x].jie[i]<>y)and b[a[x].jie[i]] and (a[x].jdata[i]>50) then begin dfs1(a[x].jie[i],y); end; end; end;