摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3279数状数组#include <stdio.h>#include <string.h>#define lowbit(x) ((x)&(-x))int n;int a[100005],b[100005];void update(int x,int v){ while(x <= n) { a[x] += v; x += lowbit(x); }}int sum(int x){ int ret = 0; while(x) { ret += 阅读全文
posted @ 2011-07-27 19:54 zhangteng 阅读(209) 评论(0) 推荐(0) 编辑