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

建议使用的浏览器:

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

2760:End of Windless Days

题目描述
Jiajia went back to his little hometown for Spring Festival. Due to the poverty of the town, Jiajia was unable to see Wind or hear her voice through QQ for 5 days. You know, that was terrible to Jiajia, so he could only sleep a lot, hopping to see Wind in wonderful dreams.

Finally, Jiajia was in the airport, so he will soon be able to see his honey, Wind. Again, he decided a dream another dream, to spend the boring time in the waiting room. But this time he was unable to sleep, since there was a super light hanging in the ceiling, and the light was too strong to sleep in. Luckily, Jiajia found that there are some curtains somewhere below the light, blocking some rays. The floor and curtains are rectangular-shaped. The planes in which a curtain lies in are parallel to the floor, and when projected to the floor, the sides of curtains are parallel to those of the floor.

Jiajia is interested in the total area on the floor covered by the light, could you write a program to do this? Jiajia would be very happy if he receives this program as a special gift, at the end of windless days.
输入解释
The first line contains a single integer n, the number of curtains. The second line contains four integers minx,miny,maxx,maxy, where minx < maxx, miny < maxy. That means the floor lies in range [minx,miny]-[maxx,maxy]. The floor has a height of 0. The third line contains three integers lx, ly, lh, that is the position of the super light.

The following n lines each has 5 integers x1,y1,x2,y2,h, where minx < x1 < x2 < maxx, miny < y1 < y2 < maxy, 0 < h < lh. This means the curtain lies in range [x1,y1]-[x2,y2], the height of the curtain is h.

You may assume that n<=500, every other numbers in the input do not exceed 20000 in absolute value. If two numbers differ at most 10-6, they are considered to be equal. Be careful that there may be many many cases.
输出解释
The output contains a single real number, the total area on the floor covered by the light. The answer should be rounded to 4 decimal places.
输入样例
2
-10 -10 10 10
0 0 2
0 0 5 5 1
-5 -5 0 0 1
输出样例
200.0000

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2760

最后修改于 2020-10-29T06:42:13+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000 65536