一个小bug搞了半天,由于没有离散化,线段树的域的空间应该是4*maxn,maxn为x坐标的最大值View Code #include<cstdio>#include<cstring>#include<algorithm>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn = 50000; //maxn 为 x 的最大值(如果离散化了就是矩形的个数*2)int sum[maxn<<2];int cover[ma Read More
posted @ 2012-02-02 19:57
Because Of You
Views(308)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号