2012年8月20日
摘要: 线段树基础题: 1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 200000+100 4 5 int T, N, D, tree[MAXN], num; 6 char s[10]; 7 8 void updata(int cur, int j) 9 {10 for(int i = D+cur; i^1; i >>= 1)11 tree[i] += j;12 }13 14 int query(int x, int y)15 {16 int i = D+x-1, j = D+y+1,ans = 0; 阅读全文
posted @ 2012-08-20 17:14 BFP 阅读(148) 评论(0) 推荐(0) 编辑