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

并查集,O(n^2logn)

Posted by 1500012922 at 2019-09-27 11:18:00 on Problem 2253
思路:
i.两层循环把所两两边插入最小堆
ii.每次从堆顶取出最小的边,合并两个定点,检查0点和1点是否被合并。若被合并,算法结束,否则继续。

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