2012年6月12日

摘要: 好久都没喷人了,对于某些人的智商只能说呵呵。队都退了还要怎么样,做人留一线听不懂? 阅读全文
posted @ 2012-06-12 23:44 LegendaryAC 阅读(120) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1698做的第一道线段树成段更新的题目,lazy标志起到的作用的延迟更新(为了保证O(logN)的效率,不延迟就变成O(N))。这道题反正就询问一次,最后直接输出即可。View Code #include <iostream>using namespace std ; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1const int maxn=100002 ;int sum[maxn<<2] ;int lazy[ 阅读全文
posted @ 2012-06-12 21:14 LegendaryAC 阅读(151) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2795下午做的题,线段树单点更新广告牌高h宽w,尽可能在高处挂广告。注意h可能很大,但是我们注意到h比n大就没有意义了,这时我们让h=n(开始因为这个re了)View Code #include <iostream>using namespace std ;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=200002 ;int h,w,n ;int MAX[maxn<<2] ;void 阅读全文
posted @ 2012-06-12 21:10 LegendaryAC 阅读(87) 评论(0) 推荐(0) 编辑