Skip to content

Ch7 区间操作 #33

@SamZhangQingChuan

Description

@SamZhangQingChuan

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

    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);
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions