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 black_snow at 2009-09-18 17:32:45 on Problem 2782
原来以为是二分,没想到二分的自己老调不过,后来只能用HASH咯,没想到竟然只有79MS...
   数据太弱了
设置一个HASH数组表示但前剩下的每个长度的个数,因为l<=10000所以远比o(n2)的算法好。
   每次如果hash[a[i]]>0就ans++;然后扫l-a[i],刚开始赋值hash[0]:=500000

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