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 |
一点技巧,直接在原Prim算法中作一点修改用Prim算法,把已经connected的边权重用0.1表示,而记录sum为int型,由于给出的数据权重都是>=1,那么只要算法中发现有0.1时候都会选这边,就像跟没有conneted之前一样,而sum为int 型,+0.1还是原来的值,就等于没有加到,就可以符合题目的要求了。一点意见,发现问题告诉我哦~~ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator