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

O(N)-O(sqrt(N))的方法 388K 1922MS

Posted by leonardWang at 2011-01-04 01:20:28 on Problem 3264
将数组分成多段每段长度sqrt(N),预先求好每段的最大最小值,然后再进行O(sqrt(N))的查找 思路也比较直观
内存使用非常少 写起来和ST差不多 比线段树要简单很多  代码就不贴了 具体方法可参考下面的链接:http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=lowestCommonAncestor

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