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

建议使用的浏览器:

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

2948:Geometry Darts

题目描述
Bob and Hannah like to play darts. They are not very good at it, however, so finishing a round of 501 Darts will take an eternity. They therefore decide to throw away the dartboard completely and put geometric shapes on the wall instead, awarding points according to the number of shapes the dart penetrates. To reduce the complexity of scoring, they only use circles, triangles and rectangles.


A game consists of each person throwing 3 darts each, and your job is to find the winner of the game, given the shapes and the throws.
输入解释
The input will start with a line giving the total number of shapes, S. Then follow S lines describing the shapes, in either of the following formats:

1. C x y r, where (x, y) is the center of the circle, and r is the radius.

2. R x1 y1 x2 y2, where (x1, y1) and (x2, y2) are two corners of the rectangle with x1 < x2 and y1 < y2.

3. T x1 y1 x2 y2 x3 y3, where (xi, yi) are the three corners of the triangle.

Then follows a line with N, the number of games Bob and Hannah play. Each game is described with six lines giving the x and y coordinates of the 6 throws, the first three by Bob and the last three by Hannah.
输出解释
Output the name of the winner on a separate line for each game, or Tied if there is a tie.


Notes and Constraints
0 < S <= 1000
0 < N <= 1000

All rectangles have sides parallell to the x- and y-axis.

For triangle specifications, the three points will never be collinear.

All coordinates are given with double precision, with up to 6 decimals after the
decimal points.

All shapes are bounded by the rectangle defined by the two points (-1000,-1000)
and (1000, 1000).

All throws are guaranteed to be at least 10^-6 away from any shape boundary.
输入样例
3
C 0.0 0.0 5.0
R -1.0 -1.0 7.0 7.0
T 0.0 0.0 -3.0 0.0 0.0 -8.0
1
0.0 4.1
0.0 6.2
0.0 8.1
-0.5 -0.5
-0.5 -2.0
-0.5 -5.1
输出样例
Hannah
来自杭电HDUOJ的附加信息
Recommend gaojie

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

题目来源 IDI Open 2009

源链接: HDU-2948

最后修改于 2020-10-25T22:58:32+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)