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

单纯的dijkstar算法,只要加上等级考虑就可以了,我的具体解题思路。。。。。。

Posted by ssadwlll at 2008-05-16 11:47:07 on Problem 1062 and last updated at 2008-05-16 11:47:45
distance数组保存当前找到的最短路
distance的计算书上写的很清楚,就是dijkstar
然后再定义max,min数组保存当前路径的最大等级和最小等级,如果发现当前路径的等级差超过题目的要求,就把这条路设置为断路,就是令distance中相应位置的值变为最大即可
这和计算distance数组的原理差不多的!
所以说这基本上是dijkstar算法,没多大改动!!!

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