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:我用spfa最短路一直超时,有大牛用此方法过的给点指点,谢谢!~

Posted by Refresh at 2012-02-13 08:03:14 on Problem 3249
In Reply To:我用spfa最短路一直超时,有大牛用此方法过的给点指点,谢谢!~ Posted by:boys at 2007-07-08 20:03:00
最坏的情况下,n次spfa,也就是说O(n^2),绝对超时。例如:10000个点(入度为0)都指向一条长度为90000的链的首端,spfa做,需要9*10^8次。

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