当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6369:Rectangle Outline

题目描述
Given a series of rectangular obstacles, one per line. Rectangular obstacles can overlap each other. Each rectangular obstacle is specified as two points on 2D plane that specify the opposite corners of a rectangle. Your job is to calculate the outline of the coverage area of all rectangular.

If the outline is made up of more than one closed polyline, print "Oops!". Otherwise, output the answer as follows: The first output point has the smallest X coordinate and then smallest Y coordinate. The second point has the same X coordinate with the first point. Then output other points in outline order. You can see more details in Sample.

It's guarantee that every rectangle's sides are parallel to OX and OY. Any point on the 2D plane will not be the vertices of two rectangles at the same time.
输入解释
The first line contain a integer $T$(no more than 10), the following is $T$ test case, for each test case:

The first line of each test case contains a integers n (1 $\le$ n $\le$ 100,000), number of rectangular obstacles.

Each of the next n lines contains 4 integers x1, y1, x2, y2 (1 $\le$ x1 < x2 $\le$ 1,000,000,000, 1 $\le$ y1 < y2 $\le$ 1,000,000,000) specify a rectangular obstacles.

It is guaranteed that the sum of all n does not exceed 700,000.
输出解释
Output the answer as described previously.
输入样例
3
2
1 1 3 3
2 2 4 4
4
1 2 2 5
3 2 4 5
2 1 3 3
2 4 3 6
2
1 1 2 2
3 3 4 4
输出样例
8
1 1
1 3
2 3
2 4
4 4
4 2
3 2
3 1
Oops!
Oops!
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6369

最后修改于 2020-10-25T23:30:43+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/10000MS(Java/Others) 262144/262144K(Java/Others)