CF1028F.Make Symmetrical
普及/提高-
通过率:0%
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.
输入格式
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 .
输出格式
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.