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

Re:要注意删边后的图不一定还会联通,因此在写算法时要有一个判断图是否联通的操作,不能直接就返回最小生成树的的值,血的教训!!!

Posted by 1986115833 at 2020-01-19 20:14:32 on Problem 1679
In Reply To:要注意删边后的图不一定还会联通,因此在写算法时要有一个判断图是否联通的操作,不能直接就返回最小生成树的的值,血的教训!!! Posted by:1986115833 at 2020-01-19 20:08:54
测试数据应该都是联通的,但自己删边后会导致图不连通,如果用一个不判断图是否联通的prim()算法来算的话,就会出错

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