![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树(模板来自胡浩大神)
文章平均质量分 61
Shimmer_
大一 ACMer
展开
-
线段树模板-单点增减 区间求和模板
#include #define lson l , m , rt << 1#define rson m + 1 , r , rt << 1 | 1const int maxn = 55555;int sum[maxn<<2];void PushUP(int rt) { sum[rt] = sum[rt<<1] + sum[rt<<1|1];}void build(int l,in原创 2014-09-18 17:32:52 · 618 阅读 · 0 评论 -
线段树模板-单点替换区间最值
#include #include using namespace std; #define lson l , m , rt << 1#define rson m + 1 , r , rt << 1 | 1const int maxn = 222222;int MAX[maxn<<2];void PushUP(int rt) { MAX[rt] = max(MAX[rt<<1]原创 2014-09-18 17:56:29 · 590 阅读 · 0 评论