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算法中作一点修改

Posted by loveKid at 2009-03-02 17:35:59 on Problem 2421
用Prim算法,把已经connected的边权重用0.1表示,而记录sum为int型,由于给出的数据权重都是>=1,那么只要算法中发现有0.1时候都会选这边,就像跟没有conneted之前一样,而sum为int 型,+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