
模板
Cliu__
自己选择的路,就算跪着也要走完!
展开
-
洛谷P3374 树状数组
https://www.luogu.org/problem/show?pid=3374用树状数组对单个数据操作,然后查询一段区间。 注意:对单个数据操作前应将初始值加入树状数组中。#include<iostream>#include<cstdio>using namespace std;int n,m,a[500005],p,x,y,t[500005];int lowbit(int x){原创 2017-08-30 19:28:34 · 1561 阅读 · 0 评论 -
洛谷P3368 树状数组
https://www.luogu.org/problem/show?pid=3368对每个区间中的每个数进行操作,输出某一个数的值。 对区间操作时,应该让 [1-(l-1)]-x, [1-r] +x.#include<iostream>#include<cstdio>using namespace std;using namespace std;int n,m,a[500005],p,x原创 2017-08-30 19:31:44 · 520 阅读 · 0 评论