QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 512 MB مجموع النقاط: 100

#2838. 二维几何

الإحصائيات

在二维平面上有 $n$ 个不同的点。第 $i$ 个点的坐标为 $(x_i, y_i)$。

如果存在三个点 $A, B, C$ 构成一个面积为正的三角形 $ABC$,Bobo 可以将它们同时从平面上移除。如果有多个面积为正的三角形,Bobo 可以选择移除其中任意一个。求在执行任意次数操作后,平面上剩余点的最小数量。

输入格式

输入包含多组测试数据,以文件结束符(EOF)结束。对于每组测试数据:

第一行包含一个整数 $n$。

接下来的 $n$ 行中,第 $i$ 行包含两个整数 $x_i$ 和 $y_i$。

  • $1 \le n \le 2 \times 10^5$
  • 对于每个 $1 \le i \le n$,$0 \le x_i, y_i \le 10^9$
  • 对于每个 $1 \le i < j \le n$,$(x_i, y_i) \neq (x_j, y_j)$
  • 每组输入中,$n$ 的总和不超过 $2 \times 10^5$。

输出格式

对于每组测试数据,输出一个整数,表示剩余点的最小数量。

样例

样例输入 1

3
0 0
0 1
0 2
3
0 0
0 1
1 0
6
0 0
0 1
0 2
0 3
1 1
1 2

样例输出 1

3
0
0

说明

对于第三组测试数据,如果 Bobo 选择先移除三角形 $\{(0, 1), (1, 1), (1, 2)\}$,则没有其他三角形可以移除。或者,Bobo 也可以先移除三角形 $\{(0, 0), (0, 1), (1, 1)\}$,然后再移除 $\{(0, 2), (0, 3), (1, 2)\}$。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.