整段修改刚开始还求前后两值的差,卡了一下发现直接改就行了。 题意和题解: 线段树板子区间修改区间查询,由于本题查一整段所以无需查询操作 代码: //修改区间为同一个值 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int T, n, m; struct Node{ int l, r; int sum, add; }tr[N << 2]; void pushup(int u) {...