求助,直接拿 vector 当平衡树用能卡吗?本题 和 P5314 [Ynoi2011] ODT 都能被草过去,并且比我的 fhq 快一倍。
struct PingHengShu
{
vector <int> s;
void ins(int x) {s.insert(lower_bound(s.begin(),s.end(),x),x);}
void del(int x) {s.erase(lower_bound(s.begin(),s.end(),x));}
void clear() {s.clear();}
int getrk(int k) {return upper_bound(s.begin(),s.end(),k)-s.begin();}
};