QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 512 MB 總分: 100

#3346. 几何飞镖

统计

Bob 和 Hannah 喜欢玩飞镖。然而,他们的技术并不好,完成一轮 501 分的飞镖游戏需要花费极长的时间。因此,他们决定彻底抛弃飞镖盘,转而在墙上放置几何图形,并根据飞镖击中的图形数量来计分。为了降低计分的复杂性,他们只使用圆形、三角形和矩形。

一场游戏由每人各投掷 3 次飞镖组成,你的任务是根据给定的图形和投掷位置,找出游戏的获胜者。

输入格式

输入的第一行包含一个整数 $S$,表示图形的总数。接下来 $S$ 行描述这些图形,格式如下:

  1. C x y r,其中 $(x, y)$ 是圆心坐标,$r$ 是半径。
  2. R x1 y1 x2 y2,其中 $(x_1, y_1)$ 和 $(x_2, y_2)$ 是矩形的两个对角顶点,且满足 $x_1 < x_2$ 和 $y_1 < y_2$。
  3. T x1 y1 x2 y2 x3 y3,其中 $(x_i, y_i)$ 是三角形的三个顶点。

随后的一行包含一个整数 $N$,表示 Bob 和 Hannah 进行的游戏场数。每场游戏由 6 行描述,给出 6 次投掷的 $x$ 和 $y$ 坐标,前 3 次由 Bob 投掷,后 3 次由 Hannah 投掷。

输出格式

对于每场游戏,在单独的一行中输出获胜者的名字,如果平局则输出 Tied

数据范围

  • $0 < S \le 1000$
  • $0 < N \le 1000$
  • 所有矩形的边均平行于 $x$ 轴和 $y$ 轴。
  • 对于三角形,三个顶点永远不会共线。
  • 所有坐标均以双精度浮点数给出,小数点后最多有 6 位。
  • 所有图形均被限制在由点 $(-1000, -1000)$ 和 $(1000, 1000)$ 定义的矩形区域内。
  • 保证所有投掷点距离任何图形边界至少 $10^{-6}$。

样例

输入格式 1

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

输出格式 1

Hannah

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.