主席树的应用 若该位置的数出现过就把该版本的之前的位置-1 再把该版本的该位置+1,否则直接+1
查询的时候 有点像zkw线段树那种 - -
(哎呀..遭不住了啊..手真是贱啊..总是写错..花了一个小时debug真是菜啊TAT)
#include <cstdio>
#include <cstring>
#include <algorithm>
#define lson st[num].ls
#define rson st[num].rs
using namespace std;
const int MAXN = 30100;
struct node
{
int ls,rs,cnt;
};
struct
{
int rt[MAXN],cur,rc;
node st[MAXN*20];
inline void _pushUp(int ......
阅读全文