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:19次提交后:SAP+邻接表出现TLE,RE的总结

Posted by ysjjovo at 2011-08-11 17:20:06 on Problem 1459
In Reply To:19次提交后:SAP+邻接表出现TLE,RE的总结 Posted by:a576323437 at 2011-08-07 21:54:06
> 注意事项:
> 1最多有100个点,加上加入的源点跟汇点,总共有102个点。开点数组为110
> 2中间边数最多为100*100=10000,还有100个中间点分别跟源点和汇点的边共200条,还要算上反向边,所以使用邻接表的话边数需要(10000+200)*2=20400,开数组为20500
> 19次提交中:
> RE的原因有
> 1.cnt没有初始化,导致cnt一直在加,所以超出数组范围。
> 2.存边的数组开得太小。貌似开20010都RE了。
> TLE的原因:
> 也是数组开得太小,有时报RE有时报TLE。。。
> 其实这道题用矩阵存图比邻接表存图用的内存小,用邻接表19次提交中快慢是79ms,最快是47ms...SAP+邻接表党万岁。。。。。

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