正文
增加 11 行删除 11 行
12345678912 行未改动22232425262728293031323334353637383924 行未改动646566676869707172737430 行未改动1051061071081091101111121134 行未改动11811912012112212312412512662 行未改动# **P14634 Voronoi Diagram Returns**## **问题概述**给定平面上 $n$ 个点 $P_1, P_2, \dots, P_n$ 作为 Voronoi 图的生成点。对于每个查询点 $Q$,需要判断 $Q$ 属于 Voronoi 图的:- 某一个唯一区域 → `REGION i`- 两个区域的公共边界 → `LINE i j`12 行未改动根据 Voronoi 图定义:$$Q \in \text{Region}(i)\iffd(Q,P_i) \le d(Q,P_j),\quad \forall j.$$因此对每个查询点 $Q$,只需:1. 遍历全部 $P_i$ 计算距离平方 $d_i$2. 找到最小距离 $d_{\min}$3. 统计有多少个 $P_i$ 满足 $d_i = d_{\min}$结论如下:$$24 行未改动四个生成点:$$P_1=(-5,0),\P_2=(0,5),\P_3=(3,4),\P_4=(1,-6)$$### **查询 $Q_1=(-2,2)$**30 行未改动---## **总结**本题不需要真正构建 Voronoi 图,只需判断“最小距离出现次数”。暴力即可通过,代码短且稳定。---4 行未改动// Contest: Luogu// URL: https://www.luogu.com.cn/problem/P14634// Memory Limit: 1024 MB// Time Limit: 10000 ms//// Powered by CP Editor (https://cpeditor.org)#include<bits/stdc++.h>using namespace std;62 行未改动12345678912 行未改动22232425262728293031323334353637383924 行未改动646566676869707172737430 行未改动1051061071081091101111121134 行未改动11811912012112212312412512662 行未改动# **P14634 Voronoi Diagram Returns**## **问题概述**给定平面上 $n$ 个点 $P_1, P_2, \dots, P_n$ 作为 Voronoi 图的生成点。对于每个查询点 $Q$,需要判断 $Q$ 属于 Voronoi 图的:- 某一个唯一区域 → `REGION i`- 两个区域的公共边界 → `LINE i j`12 行未改动根据 Voronoi 图定义:$$Q \in \text{Region}(i)\iffd(Q,P_i) \le d(Q,P_j),\quad \forall j.$$因此对每个查询点 $Q$,只需:1. 遍历全部 $P_i$ 计算距离平方 $d_i$2. 找到最小距离 $d_{\min}$3. 统计有多少个 $P_i$ 满足 $d_i = d_{\min}$结论如下:$$24 行未改动四个生成点:$$P_1=(-5,0),\P_2=(0,5),\P_3=(3,4),\P_4=(1,-6)$$### **查询 $Q_1=(-2,2)$**30 行未改动---## **总结**本题不需要真正构建 Voronoi 图,只需判断“最小距离出现次数”。暴力即可通过,代码短且稳定。---4 行未改动// Contest: Luogu// URL: https://www.luogu.com.cn/problem/P14634// Memory Limit: 1024 MB// Time Limit: 10000 ms//// Powered by CP Editor (https://cpeditor.org)#include<bits/stdc++.h>using namespace std;62 行未改动