摘要: 题面You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given numbe... 阅读全文
posted @ 2018-04-20 21:35 gwj1139177410 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 题面已知一个数列,你需要进行下面两种操作: 1.将某区间每一个数加上x 2.求出某区间每一个数的和题解区间修改+区间查询 线段树模板#include#define maxn 100010#define lch p>1; sgt[lch].addmark ... 阅读全文
posted @ 2018-04-20 21:33 gwj1139177410 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题面RMQ问题题解线段树#include#includeusing namespace std;const int maxn = 100010;int a[maxn];struct node{ int l, r; int val;}sgt[maxn m)a... 阅读全文
posted @ 2018-04-20 13:20 gwj1139177410 阅读(111) 评论(0) 推荐(0) 编辑
选择