QOJ.ac

QOJ

时间限制: 2 s 内存限制: 256 MB 总分: 100

#10551. 刷题之王

统计

Mr. Big 是 Brushing King 的学生之一。上课时他总是昏昏欲睡,但 Brushing King 会惩罚在课堂上睡觉的学生。为了不被 Brushing King 抓到,Big 想知道是否有安全的地方可以让他睡完整节课。

Brushing King 可以被视为一个点。他的视野是一个圆心角为 $\theta$、半径为 $R$ 的扇形。

Big 选择了几个位置睡觉,他想知道在课程期间,哪些位置不会被 Brushing King 看到。

Brushing King 总是以速度 $1$ 向某个方向行走,且其运动的方向向量已知。他可能会在某个时刻旋转他的视野方向或运动方向。课程在最后一次动作后立即结束。

注意,一旦某个位置处于 Brushing King 的视野内(即使是在 Brushing King 转头时),Mr. Big 就会被 Brushing King 抓到。触碰到视野边缘也被视为被发现。

输入格式

输入的第一行包含测试用例的数量 $T$。接下来是 $T$ 个测试用例。

对于每个测试用例,第一行包含 $n, m, \theta, R$ ($1 \le n, m, R \le 1000, 0 < \theta < 180$),分别表示 Mr. Big 选择的位置数量和 Brushing King 的动作数量。角度以度为单位给出。

第二行包含六个整数 $p_x, p_y, v_x, v_y, d_x, d_y$。 $(p_x, p_y)$ 是 Brushing King 的初始位置,$(v_x, v_y)$ 表示从 Brushing King 初始位置指向其视野扇形弧中点的初始方向向量(注意:不保证 $|(v_x, v_y)|$ 或 $|(d_x, d_y)|$ 等于 $1$ 或 $R$)。$(d_x, d_y)$ 是 Brushing King 的运动方向向量。($-2000 \le p_x, p_y \le 2000, 1 \le |(v_x, v_y)|, |(d_x, d_y)| \le 2000$)。

接下来 $n$ 行,每行包含两个整数 $x, y$ ($-2000 \le x, y \le 2000$),表示 Mr. Big 选择的位置坐标。

接下来 $m$ 行,每行包含三个整数 $p, t, \alpha$ ($0 \le t \le 2000, 0 \le \alpha \le 180$)。有两种类型的动作:

  1. $p = 1$ 表示在时间 $t$,Brushing King 将其视野的方向向量(即从其位置指向视野扇形弧中点的方向向量)顺时针旋转 $\alpha$ 度。
  2. $p = 2$ 表示在时间 $t$,Brushing King 将其运动方向向量顺时针旋转 $\alpha$ 度。

所有的 $t$ 均按严格递增顺序给出。Brushing King 的动作速度极快,可以视为瞬间完成。

输出格式

对于每个测试用例,输出一行 “Case #x:”,其中 $x$ 是测试用例编号(从 1 开始),后跟 $n$ 个数字,每个数字为 0 或 1。第 $i$ 个数字为 1 表示 Mr. Big 可以在第 $i$ 个位置存活,否则为 0。

样例

输入 1

1
3 2 90 3
0 0 0 1 0 1
50 1
-1 0
-100 0
1 1 180
1 100 0

输出 1

Case #1: 101

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.