跑的好慢啊,看到别人的几百ms,就知道这道题目不能AC了就算数先记在这View Code #include<cstdio>#include<cstring>#include<queue>#include<algorithm>using namespace std;const int M =1010;int map[M][M];int vis[M][M];int dir[8][2]={-1,0,-1,1,0,1,1,1,1,0,1,-1,0,-1,-1,-1};int r,c;int sx,sy,ex,ey;struct node{ int x,y Read More
posted @ 2012-01-14 06:17 Because Of You Views(290) Comments(0) Diggs(0) Edit
1 a:询问有没有连续长度为a的空位置,插进最左边2 a b :【a,a+b-1】区间清空结点记录的信息:1:区间内最长的连续空位(msum)2:从当前区间的最左端开始的连续空位长度(lsum)3:从当前区间的最右端开始的连续空位长度(往左边数)(rsum)区间的最值就是max(左右子节点最长连续空位的最大值,lsum【rt<<1|1】+rsum[rt<<1])其他就基本上和一般的成段更新,懒惰标记没什么区别了View Code #include<cstdio>#define lson l,m,rt<<1#define rson m+1,r,rt Read More
posted @ 2012-01-14 04:30 Because Of You Views(340) Comments(0) Diggs(0) Edit