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 cmonkey at 2012-01-20 15:55:17 on Problem 2253 and last updated at 2012-01-20 15:55:46
In Reply To:不要被误导,此题不是最短路也不是最小生成树,而是FLOYD变体 Posted by:xuchang at 2010-08-17 08:58:35
> 不是最短路也不是最小生成树,所以用DIJ或者PRIM就算能AC也不一定对 
那要看怎么理解了
DIJ本身有贪心的思想
如果定义dis[i]为i到起点s路径中最大边长
relax: dis[i] = min(dis[i], max(dis[j], edge[i][j]))
基于贪心:如果当前dis[k]是最小的,那么后面没有点能更新k,即k到s路径中最大边的最小值找到了
只要上述贪心没问题,算法就没问题。
个人理解...欢迎讨论指正~

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