等差:
https://www.luogu.org/problemnew/show/P1438
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include
等比:
1 void push_down(int ind,int len)2 {3 u[ind<<1]+=u[ind];4 v[ind<<1]+=v[ind];5 u[ind<<1|1]+=u[ind]+pow(v[ind],len);6 v[ind<<1|1]+=v[ind];7 u[ind]=0;8 v[ind]=0;9 }