主席树
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【SPOJ - DQUERY】D-query(权值树状数组 或 主席树 或 莫队)
题干: 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 ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elements in...原创 2018-10-08 00:55:15 · 288 阅读 · 0 评论 -
【HDU - 6183】Color it(CDQ分治 或 动态开点线段树)
题干: Do you like painting? Little D doesn't like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy painting, Little D asks you to write a program ...原创 2019-04-12 15:20:32 · 251 阅读 · 0 评论 -
【HDU - 2665】Kth number(区间第K大,主席树,模板)
题干: Give you a sequence and ask you the kth big number of a inteval. Input The first line is the number of the test cases. For each test case, the first line contain two integer n and m (n, m <...原创 2019-08-18 21:38:04 · 193 阅读 · 0 评论 -
【HDU - 4417】Super Mario(查询区间小于K的数的个数,主席树)
题干: Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble again and Mario needs to save his lover. We regard the ro...原创 2019-08-18 22:40:37 · 540 阅读 · 0 评论 -
【HDU - 4348】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 al...原创 2019-08-19 15:37:30 · 599 阅读 · 0 评论