线段树(模板)
//1 x y k:将区间[x,y]内每个数加上k。
//2 x y:输出区间[x,y]内每个数的和。
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+10;
ll a[N];
struct node
{
ll v,f;
}tree[4*N];
void build(ll l,ll r,ll now)//建树
{
tree[now].f=0;
if(l=.
原创
2020-09-21 21:36:22 ·
60 阅读 ·
0 评论