
主席树
灰黑飞
用智慧的程序写出美好的未来。
展开
-
主席树
可持久化线段树,也叫作函数式线段树,也就是主席树,(。。。因为先驱就是fotile主席。。Orz。。。) 网上的教程很少啊,有的教程写得特别简单,4行中文,然后就是一篇代码~~ 这里,我将从查找区间第k小值(不带修改)题的可持久化线段树做法中,讲一讲主席树。 /*只是略懂,若有错误,还请多多包涵!*/ 可持久化数据结构(Persistent data structure)就是利用函数式编程原创 2014-07-30 20:28:24 · 905 阅读 · 0 评论 -
zoj 2112 主席树+树状数组求动态第k大
Dynamic Rankings Time Limit: 10 Seconds Memory Limit: 32768 KB The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply原创 2014-08-12 21:00:14 · 554 阅读 · 0 评论 -
spoj 3267. D-query 主席树求区间不同数的个数
SPOJ Problem Set (classical) Problem code: DQUERY English Vietnamese Given a sequence of n numbers a1, a2, ..., an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i原创 2014-08-13 16:57:53 · 749 阅读 · 0 评论 -
hdu 4866 主席树
hooting Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1254 Accepted Submission(s): 259 Problem Description In the shooting game,原创 2014-10-02 21:10:18 · 478 阅读 · 0 评论