2013年1月19日

摘要: 思路:二维线段树求区域最值。值得注意的是在进行Q操作时可能H1>H2,A1>A2.所以要swap.View Code 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 #define lson l,m,rt<<1 5 #define rson m+1,r,rt<<1|1 6 #define maxn1 1002 7 #define maxn2 102 8 struct node 9 { 10 int subsetree[maxn1*3]; 11 }s 阅读全文
posted @ 2013-01-19 23:28 kim888168 阅读(140) 评论(0) 推荐(0) 编辑
 
摘要: 题意:有一个n*n(n<=1000) 的矩阵,开始时全为零,现在有两种操作(1)"C x1 y1 x2 y2“表示将以(x1,y1)为左上顶点,以(x2,y2)为右下顶点的长方形区域内的值全部取反。(2)”Q x y“表示点(x,y)的值。具体思路参考国家集训队2009论文集浅谈信息学竞赛中的0和1“;我自己用的是二维线段树。View Code 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 #define maxn 1002 5 #define lson l,m,r 阅读全文
posted @ 2013-01-19 16:50 kim888168 阅读(113) 评论(0) 推荐(0) 编辑