摘要:
1 int n; 2 int a[1005],c[1005]; //对应原数组和树状数组 3 4 int lowbit(int x){ 5 return x&(-x); 6 } 7 8 void updata(int i,int k){ //在i位置加上k 9 while(i <= n){ 10 c 阅读全文
摘要:
1 struct node 2 { 3 int l,r,sum,lazy; 4 node *lson,*rson; 5 node() 6 { 7 l = r = sum = lazy = 0; 8 lson = rson = NULL; 9 } 10 }; 11 12 node* build(vec 阅读全文