Universal Cup Judging System

Universal Cup

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

มีจุด $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.