CF1423E.5G Antenna Towers
省选/NOI-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
After making a strategic plan with carriers for expansion of mobile network throughout the whole country, the government decided to cover rural areas with the last generation of 5G network.
Since 5G antenna towers will be built in the area of mainly private properties, the government needs an easy way to find information about landowners for each property partially or fully contained in the planned building area.
The planned building area is represented as a rectangle with sides width and height.
Every 5G antenna tower occupies a circle with a center in (x,y) and radius r.
There is a database of Geodetic Institute containing information about each property. Each property is defined with its identification number and polygon represented as an array of (x,y) points in the counter-clockwise direction.
Your task is to build an IT system which can handle queries of type (x,y,r) in which (x,y) represents a circle center, while r represents its radius. The IT system should return the total area of properties that need to be acquired for the building of a tower so that the government can estimate the price. Furthermore, the system should return a list of identification numbers of these properties (so that the owners can be contacted for land acquisition).
A property needs to be acquired if the circle of the antenna tower is intersecting or touching it.
在与通信运营商共同制定全国移动网络扩展战略计划后,政府决定使用最新一代5G网络覆盖农村地区。
由于5G天线塔将主要建在私人产权区域内,政府需要一种简便的方法,以获取规划建筑区域内每个部分或全部位于该区域内的地块之产权人信息。
规划建筑区域表示为一个边长为 width 和 height 的矩形。
每座5G天线塔占据一个圆,其圆心为 (x,y),半径为 r。
国家测绘研究所的数据库中存有每块地块的信息。每块地块由其标识号及一个多边形定义,该多边形以逆时针方向排列的 (x,y) 坐标点数组表示。
你的任务是构建一个IT系统,以处理形如 (x,y,r) 的查询:其中 (x,y) 表示圆心坐标,r 表示半径。该IT系统应返回需征用的地块总面积(以便政府估算征地费用),并同时返回这些地块的标识号列表(以便联系产权人进行征地)。
若天线塔所占圆形区域与某地块存在相交或相切关系,则该地块需被征用。
输入格式
The first line contains the size of the building area as double values width, height, and an integer n — the number of properties in the database.
Each of the next n lines contains the description of a single property in the form of an integer number v (3≤v≤40) — the number of points that define a property, as well as 2∗v double numbers — the coordinates (x,y) of each property point. Line i (0≤i≤n−1) contains the information for property with id i.
The next line contains an integer q — the number of queries.
Each of the next q lines contains double values x, y, r — the coordinates of an antenna circle center (x,y) and its radius r.
1≤n∗q≤106
第一行包含建筑区域的尺寸,为两个双精度浮点数 width、height,以及一个整数 n —— 表示数据库中地块的数量。
接下来的 n 行中,每行描述一个地块:首先是一个整数 v(3≤v≤40)—— 表示定义该地块的顶点数;随后是 2∗v 个双精度浮点数 —— 分别为每个顶点的坐标 (x,y)。第 i 行(0≤i≤n−1)包含编号为 i 的地块的信息。
下一行包含一个整数 q —— 表示查询的数量。
接下来的 q 行中,每行包含三个双精度浮点数 x、y、r —— 分别表示天线覆盖圆的圆心坐标 (x,y) 及其半径 r。
满足约束:1≤n∗q≤106
输出格式
For each of the q queries, your program should output a line containing the total area of all the properties that need to be acquired, an integer representing the number of such properties, as well as the list of ids of these properties (separated by blank characters, arbitrary order).
对于每个查询 q,您的程序应输出一行,包含需要征用的所有地块的总面积、此类地块的数量,以及这些地块的编号列表(以空格分隔,顺序任意)。
输入输出样例
输入#1
10 10 3 4 2 2 3 2 3 3 2 3 3 3.5 2 4.5 2 4.5 3 4 7 8 7.5 8.5 8 8 7.5 9 5 2 3.5 0.5 3.3 2 0.4 5 2.5 0.5 7.5 8.5 0.5 3 7 0.5
输出#1
1.000000 1 0 1.500000 2 0 1 0.500000 1 1 0.250000 1 2 0.000000 0
说明/提示
You can assume that the land not covered with properties (polygons) is under the government's ownership and therefore doesn't need to be acquired. Properties do not intersect with each other.
Precision being used for solution checking is 10−4.
可以假设未被地块(多边形)覆盖的土地归政府所有,因此无需征用。地块之间互不相交。
解的精度校验标准为 10−4。
输入解题思路,AI测评打分。不知道怎么写?