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

郁闷哦,用prim过了不过有个小细节啊!wa了几次。

Posted by mightyvoice at 2009-05-11 21:16:02 on Problem 1797
     第一次是把从1出发的最小变加进去而不是所有边中最小边加进去,然后求最大生成树的最小边,还有个问题就是,一旦n节点一进入树马上就return,否则求出来的就可能不是满足题意的值了。
     2485是最小生成树的最大边,1797是最小生成树的最小边。

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