CF1028F.Make Symmetrical
省选/NOI-
通过率:0%
时间限制:6.00s
内存限制:512MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Consider a set of points A, initially it is empty. There are three types of queries:
- Insert a point (xi,yi) to A. It is guaranteed that this point does not belong to A at this moment.
- Remove a point (xi,yi) from A. It is guaranteed that this point belongs to A at this moment.
- Given a point (xi,yi), calculate the minimum number of points required to add to A to make A symmetrical with respect to the line containing points (0,0) and (xi,yi). Note that these points are not actually added to A, i.e. these queries are independent from each other.
考虑一个点集 A,初始时为空。存在三种类型的查询:
- 向 A 中插入一个点 (xi,yi)。保证该点此时不在 A 中。
- 从 A 中删除一个点 (xi,yi)。保证该点此时属于 A。
- 给定一个点 (xi,yi),计算为使 A 关于过点 (0,0) 和 (xi,yi) 的直线对称,所需向 A 中添加的最少点数。注意:这些点实际上不会被加入 A,即此类查询相互独立。
输入格式
The first line contains a single integer q (1≤q≤2⋅105) — the number of queries.
Each of the following q lines describes a query and contains three integers ti, xi and yi ($ t_i \in {1, 2, 3}$, 1≤xi,yi≤112904) — the type of the query and the coordinates of the point. Type 1 is addition of the point, type 2 is removal of the point, type 3 is the query to compute the minimum number of points required to make A symmetrical.
It is guaranteed that there are no more than 105 queries of type 3 and no more than 105 queries having type 1 or 2.
第一行包含一个整数 q(1≤q≤2⋅105),表示查询次数。
接下来的 q 行每行描述一次查询,包含三个整数 ti、xi 和 yi(其中 ti∈{1,2,3},1≤xi,yi≤112904),分别表示查询类型及该点的坐标。类型 1 表示添加该点;类型 2 表示删除该点;类型 3 表示查询:为使集合 A 成为中心对称,至少需要添加多少个点。
保证类型 3 的查询总数不超过 105,且类型 1 或类型 2 的查询总数也不超过 105。
输出格式
For each query of the third type output a line with a single integer — the answer to this query.
对于每个第三种类型的查询,输出一行,包含一个整数——该查询的答案。
输入输出样例
输入#1
12 1 1 6 1 6 1 1 5 5 1 2 3 3 4 4 1 3 2 3 7 7 2 2 3 2 6 1 3 8 8 2 5 5 3 1 1
输出#1
1 0 2 2
输入#2
6 1 1 2 3 1 1 1 1 1 3 2 2 2 1 1 3 2 4
输出#2
1 1 0
说明/提示
The first example is shown on the picture below.

第一个示例见下图。

输入解题思路,AI测评打分。不知道怎么写?