求大牛指教
noip吧
全部回复
仅看楼主
level 9
怎样求桥和割点。。
蒟蒻无力
要是给个伪代码或是pascal的程序就更好了
2012年10月28日 11点10分 1
level 9
自顶,在有牛回答之前不能沉啊
2012年10月28日 12点10分 2
level 3
FS巨犇。
2012年10月28日 12点10分 4
怎么没来机房
2012年10月28日 12点10分
回复 foreversmileID :在家沐浴了....
2012年10月28日 12点10分
回复 lstlst1111 :OrzLST
2012年10月29日 13点10分
level 11
orz
2012年10月28日 12点10分 5
level 9
再顶
2012年10月29日 09点10分 6
level 12
黑书有.
2012年10月29日 10点10分 7
level 9
拼命顶啊
求大牛
2012年10月29日 13点10分 8
已发。
2012年10月29日 13点10分
level 3
Program Contact;
Var time,i,n,m,k:longint;
e,ne:array [1..800000] of longint;
p,st,dfn,low:array [0..800000] of longint;
ans,top:qword;
Procedure Init;
Var i,a,b:longint;
Procedure Insert(a,b:longint);
Begin
Inc(k);
e[k]:=b; ne[k]:=p[a]; p[a]:=k;
End;
Begin
Readln(n,m);
For i:=1 to m do
Begin
Readln(a,b);
Insert(a,b);
Insert(b,a);
End;
End;
Function min(a,b:longint):longint;
Begin
if a<b then exit(a) else exit(b);
End;
Procedure Tarjan(v,fa:longint);
Var i:longint;
s:qword;
Begin
Inc(time); dfn[v]:=time; low[v]:=time;
Inc(top); st[top]:=v;
i:=p[v];
While i<>0 do
Begin
If e[i]<>fa then
If dfn[e[i]]=0 then
Begin
Tarjan(e[i],v);
low[v]:=min(low[e[i]],low[v]);
If low[e[i]]>dfn[v] then
Begin
s:=0;
While true do
Begin
Inc(s);
Dec(top);
If st[top+1]=e[i] then break;
End;
ans:=ans+s*(s-1) div 2;
End;
End
else
low[v]:=min(low[v],dfn[e[i]]);
i:=ne[i];
End;
End;
Begin
Init;
For i:=1 to n+1 do
If dfn[i]=0 then
Begin
top:=0;
Tarjan(i,0);
ans:=ans+top*(top-1) div 2;
End;
writeln(ans);
End.

2012年10月29日 13点10分 9
Orz
2012年10月29日 14点10分
level 10
蒟蒻表示TARJAN不会……
2012年10月29日 13点10分 10
1