摘要: 参考资料:http://www.notonlysuccess.com/index.php/segment-tree-complete/hdu1166题意:对于n(n≤500000),操作有两种:①任意更改某个点的值②求任意区间的和View Code 1 #include <stdio.h> 2 const int N=50005<<2; 3 int sum[N]; 4 int T,n; 5 ///rt表示当前子树的根(root),也就是当前所在的结点 6 void PushUP(int rt){ 7 sum[rt]=sum[rt<<1]+sum[rt< 阅读全文
posted @ 2013-04-27 19:36 _sunshine 阅读(184) 评论(0) 推荐(0) 编辑