Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
原创:nlog(n)算法1. 先用well-known的prim算法生成MST; 2. 再用修改版的prim算法生成另一棵树(每次循环把权值最小的所有边加进来;一般的prim是选择权值最小的任一条边); 3. 最后比较两棵树是否相同,如果相同则MST唯一;如果不同,或者第二棵树生成失败,则MST不唯一 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator