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

建议使用的浏览器:

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

1813:Overlapped Shapes

题目描述
A small computer software company encountered a problem when developing their CAD software. The boss of this company offered a reward of $1000 on the Internet for the person who can solve this problem for them. You are now unemployed at home and want to earn the money by your proficient computer programming skill.

The problem is quite simple. Your task is just to calculate the area of the intersection of two shapes that may overlap. These two shapes both can be rectangles or circles.
输入解释
The first line of input is the number of test cases. For each test case, there are two lines describing two shapes. A line of "R x1 y1 x2 y2" represents a rectangle with top-left corner at (x1, y1) and bottom-right corner at (x2, y2). A line of "C x y r" represents a circle with center at (x, y) and radius r.

You can assume that all the numbers mentioned above are integers between 0 and 10.
输出解释
For each test case, print the nearest integer of the intersection area of the two shapes in a single line.
输入样例
4
R 0 0 10 10
C 0 0 10

C 0 0 5
R 5 5 10 10

R 1 1 3 4
R 0 0 2 4

C 0 0 10
C 0 0 10
输出样例
79
0
3
314

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

题目来源 POJ Monthly

源链接: POJ-1813

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

共提交 0

通过率 --%
时间上限 内存上限
10000 10000