摘要: 对所有边从大到小排序,枚举最大边,O(m)验证,用并查集维护图是否联通。program CODEVS1001;const maxm=5008; maxn=508; INF=2000000000;type arr=record u,v,w:int64; end;... 阅读全文
posted @ 2014-12-10 20:41 rpSebastian 阅读(214) 评论(0) 推荐(0)
摘要: 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... 阅读全文
posted @ 2014-12-10 19:48 rpSebastian 阅读(293) 评论(0) 推荐(0)