Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
别用map,因为数据范围很小,但是查询次数很多,所以hash能保证O(1)的查询效率sample里面第二个例子要运行42万多次才能得出那么多个结果,O(log(n))的map必然满足不了时间要求。 改成1000大小的hash表后马上AC了。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator