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

就是啊,不要贪心,DFS+BFS+剪枝()

Posted by 20091101579 at 2011-08-06 10:29:29 on Problem 2688
In Reply To:问问:每次找到最近的然后依次递归下去是不是错的? 这是贪心是不对的吧?应该找整体最优解而不是每次局部最优解? Posted by:20091101579 at 2011-08-05 17:30:34
因为DFS要找连接所有结点最小的距离

如果 当前累加的距离 大于 前面已经计算好的最小的距离,那么就没有必要向后计算,直接放弃

即可

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