Universal Cup Judging System

Universal Cup

حد الوقت: 1.5 s حد الذاكرة: 512 MB مجموع النقاط: 100
الإحصائيات

二維平面上有 $n$ 個點 $p_i$,其中 $p_i$ 的座標為 $(x_i, y_i)$。保證沒有兩個點重合,且沒有三點共線。

求從給定點集中選擇三個點的方法數,使得包含這三個點的任意子集的凸包都是一個三角形。

輸入格式

第一行包含一個整數 $n$ —— 點的數量。 接下來的 $n$ 行,每行包含兩個整數 $x_i$ 和 $y_i$ —— 點 $p_i$ 的座標。

輸出格式

輸出一個整數 —— 從給定點集中選擇三個點的方法數,使得包含這三個點的任意子集的凸包都是一個三角形。

數據範圍

$3 \le n \le 2000$, $|x_i|, |y_i| \le 10^9$, 沒有兩個點重合, 沒有三點共線。

範例

輸入 1

7
2 7
0 9
-2 -2
9 4
3 3
-8 -10
-2 -3

輸出 1

2

輸入 2

4
-1 -1
1 -1
0 1
0 0

輸出 2

4

輸入 3

7
-50 -33
50 -31
-93 98
-47 -59
16 -35
79 -25
-75 41

輸出 3

15

說明

第一個範例中給定的點排列如下圖所示。

problem_16124_e2b0e379fee65d47eab9b9058d2d3f59.png

在第一個範例中,以下兩種選擇三個點的方式滿足條件: $\{p_1, p_4, p_6\}$, $\{p_2, p_4, p_6\}$.

第二個範例中給定的點排列如下圖所示。

problem_16124_e5e33267351ffa355bb947c1a9e13e69.png

在第二個範例中,以下四種選擇三個點的方式滿足條件: $\{p_1, p_2, p_3\}$, $\{p_1, p_2, p_4\}$, $\{p_1, p_3, p_4\}$, $\{p_2, p_3, p_4\}$.

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.