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:不要被误导,此题不是最短路也不是最小生成树,而是FLOYD变体

Posted by Ruby931031 at 2012-09-06 23:15:52 on Problem 2253
In Reply To:Re:不要被误导,此题不是最短路也不是最小生成树,而是FLOYD变体 Posted by:Ruby931031 at 2012-09-06 21:55:27
对本题来说dijkstra的变体似更简单,因为最后求出的d[i]之间就是1到i路径上最长路的最小值,也就是要求的答案;
而prim中d[i]是节点i到生成树的距离的最小值,并不是答案,需要再求一下生成树上的最长边,略麻烦一些(当然也可以在循环的时候顺便维护这个ans,不过总觉得没有dijkstra来得直接)

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