Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

原创:nlog(n)算法

Posted by cavatina2016 at 2017-09-28 23:33:53 on Problem 1679 and last updated at 2017-09-28 23:39:42
1. 先用well-known的prim算法生成MST;
2. 再用修改版的prim算法生成另一棵树(每次循环把权值最小的所有边加进来;一般的prim是选择权值最小的任一条边);
3. 最后比较两棵树是否相同,如果相同则MST唯一;如果不同,或者第二棵树生成失败,则MST不唯一

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator