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

排序后搜索就可以到30~50ms

Posted by wrong123 at 2005-12-31 01:28:16 on Problem 2549
In Reply To:how to solve it in 15ms Posted by:ACMTino at 2005-08-28 13:52:57
搜索注意顺序,例如: t = Num[i] - Num[j] - Num[k];
i,j从大到小, k从小到大。如果 t 在 Num[k]~~Num[j]这个范围,
那么就在此范围搜索看有没有哪个数等于t

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