P3871 [TJOI2010]中位数 一眼秒掉,这不是splay水题吗,套模板 #include<bits/stdc++.h> #define IL inline #define N 150005 using namespace std; ],siz[N],val[N],cnt[N],f[N],root,ncnt; IL void pushup(int k) { siz[k]=siz[ch[k][]]+siz[ch[k][]]+cnt[k]; } IL int chk(int x) { ]=…