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:搜索过的保存 避免重复 就不会超时了

Posted by lych at 2005-11-03 20:05:44 on Problem 1088
In Reply To:Re:搜索过的保存 避免重复 就不会超时了 Posted by:lych at 2005-11-03 20:00:02
具体来说,当你求一个点A的最远点B的时候,你同时也求出了从A到B这条路上的所有点的最远点,将他们保存下来,避免重复搜索即可避免超时.该算法的复杂度大概为O(n^2).

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