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

我的质疑

Posted by Snow_storm at 2010-10-15 01:08:08 on Problem 3169
如果单单是作1~N的最短路  是否漏掉了不可达点?如此-1的情况是否就遗漏了? 而且会错误的 输出dis[N],同时-2的判断也会有问题。
所以我认为还是应该加入一个特殊源点V0,用来保证所有点可达,从而不会漏掉无解-1的情况。同时判断-2时,应改为如果 dis[1] == inf || dis[n]==inf 即为-2  否则 输出dis[n]-dis[1]

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