就是用了upper_bound优化插入 inline void ins(int x,int i) { v[i].insert(upper_bound(v[i].begin(),v[i].end(),x),x); }