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

别用map,因为数据范围很小,但是查询次数很多,所以hash能保证O(1)的查询效率

Posted by 3090101804 at 2014-01-23 23:27:00 on Problem 1783
sample里面第二个例子要运行42万多次才能得出那么多个结果,O(log(n))的map必然满足不了时间要求。
改成1000大小的hash表后马上AC了。

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