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 PureWhiteWing at 2019-06-27 11:15:12 on Problem 3259
感觉这题数据还是水了点,Bellman-Ford算法过的,先找有无负环,有负环则一定满足要求,如果没有负环就计算最短距离,如果从起点到起点的最短距离小于0则满足要求,否则不满足要求。
从我的结果来看,顶点数组开501,边数组开5200够用。数据的图应该都是连通图,所以只要计算从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