随笔分类 -  离散化

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1543 1 #include 2 #include 3 #include 4 #define maxn 10000 5 using namespace std; 6 7 int h,w,n; 8 int X[maxn],Y[maxn],m[500][500],clo[maxn]; 9 struct node10 {11 int x1,y1,x2,y2,c;12 }p[maxn*4];13 14 int bs(int key,int l,int r,int a[])15 {16 int ... 阅读全文
posted @ 2014-03-07 16:47 null1019 阅读(196) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=1151这道题就是给你一些矩形的左上角和右下角的坐标,这些矩形可能有重叠,求这些矩形覆盖的面积。先把x坐标和y坐标分别离散化。然后再求面积。 1 #include 2 #include 3 #include 4 #define maxn 510 5 using namespace std; 6 7 int n; 8 double x2,y2,x1,y1; 9 bool flag[maxn][maxn];10 double X[maxn],Y[maxn];11 struct node12 {13 double x1,y1,x2,... 阅读全文
posted @ 2014-02-20 21:20 null1019 阅读(178) 评论(0) 推荐(0)