This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include<bits/stdc++.h>
usingnamespacestd;
intconstN=50010;
intn,m;
// 树状数组模板
intc1[N],c2[N];
#define lowbit(x) (x & -x)
typedeflonglongLL;
voidadd(intc[],intx,intd){
for(inti=x;i<N;i+=lowbit(i))c[i]+=d;
}
LLsum(intc[],intx){
LLres=0;
for(inti=x;i;i-=lowbit(i))res+=c[i];
returnres;
}
intmain(){
#ifndef ONLINE_JUDGE
freopen("LOJ10115.in","r",stdin);
#endif
intk,l,r;
scanf("%d%d",&n,&m);// 第一行 n,m 表示道路总长为 n,共有 m 个操作;