(中等) HDU 3265 Posters , 扫描线。】的更多相关文章

Problem Description Ted has a new house with a huge window. In this big summer, Ted decides to decorate the window with some posters to prevent the glare outside. All things that Ted can find are rectangle posters. However, Ted is such a picky guy th…
HDU 3265 Posters pid=3265" target="_blank" style="">题目链接 题意:给定一些矩形海报.中间有孔.求贴海报的之后的海报覆盖面积并 思路:海报一张能够分割成4个矩形.然后就是普通的矩形面积并了,利用线段树维护就可以 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3265 给你n个中间被挖空了一个矩形的中空矩形,让你求他们的面积并. 其实一个中空矩形可以分成4个小的矩形,然后就是面积并,特别注意的是x1 == x3 || x2 == x4的时候,要特判一下,否则会RE. #include <iostream> #include <cstring> #include <cstdio> #include <algorithm>…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3265 题意:给你一张挖了洞的墙纸贴在墙上,问你总面积有多少. 挖了洞后其实就是多了几个矩形墙纸,一张墙纸挖了洞后可以分成4个小矩形至于怎么分看个人喜好,然后再求个矩形的面积并 要注意的是x1==x3||x2==x4||y1==y3||y2==y4时不用分矩形这是个小小的优化. #include <iostream> #include <cstring> #include <alg…
第一次做扫描线,然后使我对线段树的理解发生了动摇= =..这个pushup写的有点神奇.代码如下: #include <stdio.h> #include <algorithm> #include <string.h> #define t_mid (l+r>>1) #define ls (o<<1) #define rs (o<<1|1) #define lson ls,l,t_mid #define rson rs,t_mid+1,…
矩形面积并,一个拆成四个 #include<cstdio> #include<cstring> #include<cmath> #include<map> #include<algorithm> using namespace std; +; struct Seg { long long x; long long Y1,Y2;//离散化之后的坐标 long long flag; }s[*maxn]; *maxn],X2[*maxn],Y1[*ma…
找最深的圆,输出层数 类似POJ 2932的做法 圆扫描线即可.这里要记录各个圆的层数,所以多加一个维护编号的就行了. /** @Date : 2017-10-18 18:16:52 * @FileName: HDU 3511 圆扫描线.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$ */ #include <bi…
Description Ted has a new house with a huge window. In this big summer, Ted decides to decorate the window with some posters to prevent the glare outside. All things that Ted can find are rectangle posters. However, Ted is such a picky guy that in ev…
Posters Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5230    Accepted Submission(s): 1220 Problem Description Ted has a new house with a huge window. In this big summer, Ted decides to decora…
Problem Description A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially or totally covered by the others. The length of th…