Universal Cup Judging System

Universal Cup

Limite de temps : 1.5 s Limite de mémoire : 512 MB Points totaux : 100
Statistiques

ישנן $n$ נקודות $p_i$ במישור דו-ממדי, כאשר $p_i$ ממוקמת בקואורדינטות $(x_i, y_i)$. מובטח שאין שתי נקודות הנמצאות באותו מיקום, ואין שלוש נקודות הנמצאות על ישר אחד.

מצאו את מספר הדרכים לבחור שלוש נקודות מהקבוצה הנתונה כך שהקמור (convex hull) של כל תת-קבוצה המכילה את שלוש הנקודות הללו הוא משולש.

קלט

השורה הראשונה מכילה מספר שלם $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.