摘要:
View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #define N 1026 5 int c[N][N],s; 6 int lowbit(int i){ 7 return i&(-i); 8 } 9 void update(int x,int y,int val){10 int i,j;11 for(i=x;i<=s;i+=lowbit(i))12 for(j=y;j<=s;j+=lowbit(j))13 c[i][j]+=val... 阅读全文
摘要:
View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #define N 1005 5 int c[N][N],n; 6 7 int lowbit(int i){ 8 return i&(-i); 9 }10 11 void update(int x,int y,int val){12 int i,j;13 for(i=x;i<=n;i+=lowbit(i))14 for(j=y;j<=n;j+=lowbit(j))15 c[i][j... 阅读全文