链剖。。。题解看hz的。。。。离线搞
1 #include2 #define lowbit(a) ((a)&(-(a))) 3 #define l(a) ((a)<<1) 4 #define r(a) ((a)<<1|1) 5 #define clr(a,x) memset(a,x,sizeof(a)) 6 #define rep(i,l,r) for(int i=l;i<(r);i++) 7 #define Rep(i,a) rep(i,0,e[a].size()) 8 typedef long long ll; 9 using namespace std; 10 int read() 11 { 12 char c=getchar(); 13 int ans=0,f=1; 14 while(!isdigit(c)){ 15 if(c=='-') f=-1; 16 c=getchar(); 17 } 18 while(isdigit(c)){ 19 ans=ans*10+c-'0'; 20 c=getchar(); 21 } 22 return ans*f; 23 } 24 struct node{ 25 int l,r,sum,add; 26 }; 27 struct query{ 28 int x,p; 29 bool f; 30 inline bool operator<(const query&A)const{ 31 return x
>1) printf("%d\n",(ans[i]+mod)%mod);157 return 0;158 }