QOJ.ac

QOJ

Time Limit: 4 s Memory Limit: 4096 MB Total points: 100

#4345. hpmo

الإحصائيات

给定 $n$ 个互不相同的点 $(x_i, y_i)$,$m$ 个集合 $S_j = \{(x_i,y_i) \mid A_jx_i + B_jy_i + C_j > 0\}$,你需要找出一个 $1,2,\cdots, m$ 的排列 $p_1,p_2,\cdots,p_m$,使得 $|S_{p_1}| + \sum_{i=2}^m |S_{p_i} \oplus S_{p_{i-1}}| \le M$,$M$ 是给定的常数,$A \oplus B$ 表示 $(A \cup B) - (A \cap B)$。

输入格式

第一行两个整数 $n, m$;

接下来 $n$ 行每行两个整数表示 $x_i, y_i$;

接下来 $m$ 行每行三个整数表示 $A_j, B_j, C_j$。

输出格式

输出 $m$ 行,依次表示 $p_1,p_2,\cdots,p_m$。

样例数据

样例 1 输入

5 5
1 1
4 5
1 4
1 9
1 9
1 2 3
4 5 6
7 8 9
1 1 4
5 1 4

样例 1 输出

1
2
3
4
5

样例 2~3

见下发文件。

子任务

Idea:nzhtl1477,Solution:ccz181078,Code:ccz181078,Data:ccz181078

注意,使用捆绑测试。

对于 $20\%$ 的数据,满足 $1 \le n \le 10^4$,$1 \le m \le 10^4$。

对于另外 $30\%$ 的数据,满足 $x_i=y_i$ 或 $x_i = -y_i$。

对于 $100\%$ 的数据,满足 $1 \le n \le 10^5$,$1 \le m \le 2 \times 10^5$,$-10^9 \le A,B,C,x_i,y_i \le 10^9$,$M=1.8 \times 10^8$,所有输入均为整数。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.