| ||||||||||
| 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 | |||||||||
见内In Reply To:哦,和poj2750一样的方法,你的nlogn怎么搞的 Posted by:wangfangbob at 2007-10-30 14:33:48 分成logn层,每个都是长的为2^k长度。 那么我们每次要查询的段都是logn段 那么 答案要么在这logn段的某个段内,要么是横跨好几个段的 对于第一个问题我们在预处理的时候用nlogn可以做出来 第二个问题就相当于是在logn个数中查找最大子段和~这个是o(m)的,m=logn 那么每次查询就是O(logn)那么总复杂度就是NlogN 线段树会退化吧?感觉是,不太清楚。你说说你具体咋想的 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator