QOJ.ac

QOJ

Time Limit: 4 s Memory Limit: 512 MB Total points: 100

#7335. 疏散

Statistics

这是一个漆黑且暴风雨交加的夜晚。我们的特工刚刚在美洲中部执行完一项危险的任务。他的生命正处于危险之中,必须立即撤离。直升机唯一能接走他的地方是一条穿过丛林的笔直道路。特工从道路中间(标记为位置 0)出发,可以以每秒 1 米的速度向任意方向行走(正如我们之前所说,这是一个漆黑且暴风雨交加的夜晚)。

不幸的是,天气状况变得更加恶劣。一场雷暴即将来临,闪电对直升机和特工都构成了威胁。因此,直升机只有在少数特定的时间和地点才能降落。利用我们最先进的设备,我们可以精确预测闪电将在何时何地击中,以及受影响的燃烧区域。利用这些信息,确定特工可以在不被闪电击中的情况下,及时到达哪些降落点。

注意,如果降落点和闪电发生在同一时间 $t$,且它们之间的距离小于 $r$,则撤离是不可能的。

输入格式

输入的第一行包含测试用例的数量 $z$。接下来是各测试用例的描述。

每个测试用例的第一行包含一个整数 $n$ ($0 \le n \le 200\,000$):闪电的数量。 接下来的 $n$ 行,每行描述一次预期的闪电,包含三个整数 $t, x, r$ ($0 \le t \le 10^9, -10^9 \le x \le 10^9, 1 \le r \le 10^9$):闪电的时间 $t$、位置 $x$ 和爆炸半径 $r$。特工在时间 $t$ 时必须距离闪电至少 $r$ 米,否则他会被烧焦。

下一行包含可能的降落点数量 $s$ ($1 \le s \le 200\,000$)。接下来的 $s$ 行,每行包含两个整数 $t, x$ ($0 \le t \le 10^9, -10^9 \le x \le 10^9$),表示直升机可以在时间 $t$ 和位置 $x$ 降落。你必须确定特工是否也能在此时到达该位置。

所有测试用例中闪电和降落点的总数不超过 $1\,300\,000$。

输出格式

对于每个测试用例,确定所有降落点特工是否能在给定时间到达(且不被闪电击中),并输出一行答案。对于每个降落点,按照给定的顺序,如果特工可以从该点撤离,输出字符 ‘@’,否则输出 ‘*’。

样例

样例输入 1

1
2
3 -1 1
2 1 1
3
1 1
3 1
2 1

样例输出 1

@@*

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.