链接 这道题考察的还是线段树,乍一看舍去了好多线段树相关的性质,实则没有 比如懒标记,其实还是在的 当某个节点被破坏时,此时我们需要向下查询,耗时间,所以可以使用懒标记(与普通懒标记不同的是,这个是向上传播的) 也就是在destroy函数中向上更新懒标记(定义为sum,节点摧毁时有效,否则跳过) #include<iostream> using namespace std; const int N=1e6+5; int n; struct node{ int l,r; int des; int sum; }tr[N<<2]; void build(int u,int l...