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:莫队算法+线段树!复杂度(n + q)sqrt(n)*log(n),可以是无序序列,可惜TLE。。

Posted by test_solution at 2014-07-31 16:27:24 on Problem 3368
In Reply To:莫队算法+线段树!复杂度(n + q)sqrt(n)*log(n),可以是无序序列,可惜TLE。。 Posted by:JuniorBird at 2013-09-18 11:42:09
虽然不知道莫队算法是神马,但是 我觉得你的代码 有问题:

q[i].block根本就没有用上(排序是对q[i].block排的但是本质还是对q[i].l排序,

q[i].block=q[i].l/BLOCK, BLOCK是个constant),也就是说你的整个算法跟BLOCK==
sqrt(n)无关,估计也就是O(n*q*log())了。。。。

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