Dynamic Rankings Time Limit: 10000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu Submit Status Description The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find the…
BZOJ_2120_数颜色_Set+树状数组+主席树 Description 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问.墨墨会像你发布如下指令: 1. Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜色的画笔. 2. R P Col 把第P支画笔替换为颜色Col.为了满足墨墨的要求,你知道你需要干什么了吗? Input 第1行两个整数N,M,分别代表初始画笔的数量以及墨墨会做的事情的个数.第2行N个整数,分别代表初始画笔排中第i支画笔的颜色.…
The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find the k-th smallest number of the given N numbers. They have developed a more powerful system such that for N numbers a[1],…
整体二分: 对于每一个修改操作,标记为1,并且加一个标记为-1的这个位置原来值,并且对于a数列每个点都当成修改操作 然后整体二分,扫当前操作区间lr,把在值域区间标记为1和-1的操作都在树状数组对应位置上加/减出来,然后询问操作根据k和询问答案大小决定放在哪部分传下去 #include<iostream> #include<cstdio> using namespace std; const int N=1000005; int n,m,a[N],tot,ans[N],con,t[…