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

注意到每个节点其实只有5种状态,然后BFS就可以大大加速了,内详

Posted by applepi at 2010-11-04 17:34:42 on Problem 2432 and last updated at 2010-11-04 20:41:14
In Reply To:怎么又跑这么慢,求100ms以内算法 Posted by:foreverlin at 2010-01-20 17:20:43
也就是说节点不需要一圈一圈地回转,第一次转到不是正负1的圈数之后(比如3圈),之后如果变本加厉地回转(可能是30圈),就一定不是最优的了。

故记录状态的数组只需开到 f[5001][5]。

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