摘要: 线段树 单点更新http://acm.hdu.edu.cn/showproblem.php?pid=1166View Code 1 #include<stdio.h> 2 #include<string.h> 3 int sum[1000001]; 4 void push(int w) 5 { 6 sum[w] = sum[2*w]+sum[2*w+1];//更新节点值 7 } 8 void build(int l,int r,int w) 9 {10 if(l==r)11 {12 scanf("%d",&sum[w]);13 retu... 阅读全文
posted @ 2012-07-26 09:26 _雨 阅读(156) 评论(0) 推荐(0) 编辑