QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 2048 MB Puntuación total: 100

#15668. 电磁攻击

Estadísticas

在 Barareh,点对点(P2P)无线网络被用于连接基站以提供私有数据服务。在 P2P 无线网络中,每个基站使用一些定向天线与其他基站连接。如果将基站建模为点,将通信链路建模为线段,Barareh 的 P2P 网络令人惊讶地具有一些几何性质。具体来说,该网络是一个平面图,其外部边界是一个凸多边形,且所有内部面都是三角形。

在最近的世界冲突中,一个重要的问题一直困扰着 Barareh 的信息与通信技术(ICT)部部长 Khorzukhan。他想知道该网络对电磁攻击的韧性如何。在电磁攻击中,会在某个特定区域(即所谓的攻击区域)产生噪声,从而干扰通过该区域的所有通信。剩余的网络由完全处于攻击区域之外的每个基站和每条通信链路组成。具体来说,Khorzukhan 想知道剩余的网络是否仍然连通。为此,他指示他的部门分别模拟多次电磁攻击,测试网络对干扰的容忍度,并报告每次模拟后剩余的网络是否保持连通。

输入格式

输入的第一行包含三个整数 $n$、$m$ 和 $k$($3 \le n \le 10^5$,$3 \le m \le 3 \cdot 10^5$,$1 \le k \le 10^5$),分别表示基站的数量、通信链路的数量以及模拟电磁攻击的次数。

接下来的 $n$ 行中,第 $i$ 行包含第 $i$ 个基站的 $x$ 和 $y$ 坐标,两者均为非负整数($0 \le x, y \le 10^9$)。保证所有基站不共线。

接下来的 $m$ 行,每行代表一条通信链路。每行包含两个整数 $i$ 和 $j$($1 \le i, j \le n$),表示第 $i$ 个和第 $j$ 个基站之间的一条线段形式的通信链路。这 $m$ 条通信链路构成一个平面图。其外部边界是一个凸多边形,内部面均为三角形。

最后 $k$ 行表示攻击区域。每个攻击区域是一个非空矩形,由其左下角和右上角的坐标 $x_1, y_1, x_2, y_2$ 表示($0 \le x_1 < x_2 \le 10^9$,$0 \le y_1 < y_2 \le 10^9$)。所有矩形的边都平行于坐标轴。注意,如果一个基站或链路的任何部分(甚至是单个点)位于攻击区域内(包括边界),则在攻击期间它将无法使用。

输出格式

输出共 $k$ 行。对于每次攻击模拟,如果攻击后剩余的网络是连通的,则输出 Yes;否则输出 No。如果所有基站都在攻击区域内,则剩余网络为空,此时仍视为连通。

样例

输入样例 1

5 8 2
1 1
1 5
5 4
4 2
3 4
1 2
2 3
3 4
4 1
5 1
5 2
5 3
5 4
1 2 4 5
2 3 3 4

输出样例 1

No
Yes

说明

在第一次攻击模拟中,第一和第三个基站位于攻击区域之外;然而,它们之间并不连通。

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.