void update(int &rt,int l,int r,int pos,int c) {
if(!rt) {
rt = ++num;
tree[rt] = c;
}
tree[rt] = min(tree[rt],c);
if(l == r) return;
int mid = (l + r) >> 1;
if(pos <= mid) update(ls[rt],l,mid,pos,c);
else update(rs[rt],mid + 1,r,pos,c);
}
原文:https://www.cnblogs.com/wxyww/p/10095498.html