![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
主席树
Alstein
十年oi一场空,不开longlong见祖宗
展开
-
hdu4348 To the moon(可持久化线段树)
Background To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker. The premise of To The Moon is based around a technology that allows us...原创 2020-01-15 20:06:30 · 423 阅读 · 0 评论 -
Super Mario(主席树+权值线段树)
题目:添加链接描述 思路:先把数据离散化,按照权值建立主席树,然后对于一个高度h,我们找的答案是区间中不大于h的数,那么我们求取了mid后,如果h大于mid,那么左子树的数都小于h所以要统计左子树的上的数量,然后继续递归求解右子树,一直下去直到叶节点,返回它的值就ok,还有就是我们查询的高度也是离散化之后的高度。upper_bound找的时候不要找飘了 #include<bits/stdc+...原创 2020-01-14 16:16:00 · 303 阅读 · 0 评论