algorithmbook icon indicating copy to clipboard operation
algorithmbook copied to clipboard

Ch7 区间操作

Open SamZhangQingChuan opened this issue 5 years ago • 0 comments

写的太复杂了,只需要分三种情况

    void update(int l, int r, int ind, int val) {
        if(l > no[ind].r || r < no[ind].l)return; //不相交
        if(l <= no[ind].l && no[ind].r <= r) { //完全包含
        } else {//其余情况
            update(l, r, lson, val);
            update(l, r, rson, val);
        }
    }

SamZhangQingChuan avatar Mar 04 '20 13:03 SamZhangQingChuan