
线段树
favomj
吃枣药丸
展开
-
线段树区间更新+求和
对一个区间两种操作:c x y1、使区间[x,y]的数等于其开方数(四舍五入)。2、查询区间[x,y]的和。 #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> using namespace std...原创 2017-05-06 13:04:25 · 293 阅读 · 0 评论 -
线段树第k中值
#include <bits/stdc++.h> using namespace std; #define maxn 100005 #define lson l,m,level*2 #define rson m+1,r,level*2+1 int tree[100010*5]; void update(int l,int r,int level,int x,int b) { ...原创 2018-03-26 10:52:41 · 211 阅读 · 0 评论