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:用线段树查询的时候不是也是O(n)的复杂度吗?为什么不会超时呢??

Posted by jieyj at 2010-05-17 15:04:21 on Problem 2777
In Reply To:用线段树查询的时候不是也是O(n)的复杂度吗?为什么不会超时呢?? Posted by:jieyj at 2010-05-17 14:59:22
最坏的情况是最后颜色被涂成1,2,3,1,2,3……1,2,3且每次查询的时候都让你查询1到n,那查询次数岂不是都到查询到叶子节点?

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