Universal Cup Judging System

Universal Cup

Süre Sınırı: 1.5 s Bellek Sınırı: 512 MB Toplam puan: 100
İstatistikler

2 次元平面上に $n$ 個の点 $p_i$ があり、点 $p_i$ は座標 $(x_i, y_i)$ に位置しています。どの 2 点も同じ位置になく、どの 3 点も同一直線上にないことが保証されています。

与えられた点集合から 3 つの点を選ぶ方法であって、それら 3 つの点を含む任意の部分集合の凸包が三角形になるようなものの個数を求めてください。

入力

1 行目には、点の個数を表す整数 $n$ が与えられます。 続く $n$ 行のそれぞれには、点 $p_i$ の座標を表す 2 つの整数 $x_i$ と $y_i$ が与えられます。

出力

与えられた点集合から 3 つの点を選ぶ方法であって、それら 3 つの点を含む任意の部分集合の凸包が三角形になるようなものの個数を表す 1 つの整数を出力してください。

制約

$3 \le n \le 2000$、 $|x_i|, |y_i| \le 10^9$、 どの 2 点も同じ位置にない、 どの 3 点も同一直線上にない。

入出力例

入力例 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

注記

1 番目のサンプルにおける点の配置は以下の図の通りです。

problem_16124_e2b0e379fee65d47eab9b9058d2d3f59.png

1 番目のサンプルでは、3 つの点を選ぶ以下の 2 通りの方法が条件を満たします: $\{p_1, p_4, p_6\}$, $\{p_2, p_4, p_6\}$.

2 番目のサンプルにおける点の配置は以下の図の通りです。

problem_16124_e5e33267351ffa355bb947c1a9e13e69.png

2 番目のサンプルでは、3 つの点を選ぶ以下の 4 通りの方法が条件を満たします: $\{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.