摘要:        
http://acm.hdu.edu.cn/showproblem.php?pid=1754	基础线段树,单点替换,区间最值。code:#include<cstdio>#include<algorithm>usingnamespacestd;#definelsonl,m,rt<<1#definersonm+1,r,rt<<1|1constintmaxn=200010;intsum[maxn<<2];template<classT>inlinevoidscan_d(T&ret){charc;ret=0;while((    阅读全文
        posted @ 2012-05-09 08:39
追逐.
阅读(221)
评论(0)
推荐(0)
            
        
        
摘要:        
http://acm.hdu.edu.cn/showproblem.php?pid=1166	最基础的线段树,单点更新。完全跟着HH的代码风格写的。code:#include<cstdio>#definelsonl,m,rt<<1#definersonm+1,r,rt<<1|1constintmaxn=50005;intsum[maxn<<2];voidPushUp(intrt){sum[rt]=sum[rt<<1]+sum[rt<<1|1];}voidbuild(intl,intr,intrt){if(l==r){sca    阅读全文
        posted @ 2012-05-09 08:35
追逐.
阅读(216)
评论(0)
推荐(0)
 
                    
                     
                    
                 
                    
                 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号