摘要:
对所有边从大到小排序,枚举最大边,O(m)验证,用并查集维护图是否联通。program CODEVS1001;const maxm=5008; maxn=508; INF=2000000000;type arr=record u,v,w:int64; end;... 阅读全文
摘要:
program LCA(Tarjan);type arr=record u,v,w,next:longint; end;const maxn=100008; maxm=100008;var eg:array[0..maxm*4] of arr; last,lasq,a... 阅读全文