| ||||||||||
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 |
Re:你可以编个程序试试他的数据In Reply To:你可以编个程序试试他的数据 Posted by:atlas_of_rruucc at 2004-07-27 23:19:44 刚才试数据,在求MST之前判连通,不连通就来个死循环,结果WA, 去掉之后一直是RE 数据应该对的,但是JUDGE结果也应该一样啊,不管了,说说我是怎么做的 1. 先求MST,得出费用和MST的边集E 2. 当E不空, 则进行3 3. 删掉MST中的一条边 3. 若此时图连通,再求MST' 如果此时的费用和开始的一样,就说明不唯一,退出, 否则恢复这条边, 转2. 否则 转2 4. MST是唯一的,输出费用 不知道有没有什么问题? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator