Logo
(追記) (追記ここまで)

23249번 - Triangles 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1.2 초 (추가 시간 없음) 1024 MB3571217930.859%

문제

A triangle is a simple polygon having exactly three distinct corners that are not collinear. For any set $S$ of points in the plane, any triangle is said to have a conflict to $S$ if there is at least one point contained both in $S$ and in the interior of the triangle, excluding its boundary, simultaneously.

Now, the set $S$ is given to be a set of $n$ points in the plane, no three of which are collinear, and let $T$ be the set of all triangles whose corners are chosen from the set $S$. How many of those in $T$ do have a conflict to $S$?

Write a program that outputs the number of triangles in $T$ that have a conflict to $S$.

입력

Your program is to read from standard input. The input starts with a line containing an integer $n$ (3ドル \le n \le 500$), where $n$ is the number of points in the set $S$. Each of the following $n$ lines consists of two integers, each between $-10^6$ and 10ドル^6,ドル representing the coordinates of each point in the set $S$. It is guaranteed that no three points in the set $S$ are collinear.

출력

Your program is to write to standard output. Print exactly one line. The line should contain an integer that represents the number of triangles whose corners are chosen from the set $S$ and that have a conflict to the set $S$.

제한

예제 입력 1

4
1 1
0 0
2 3
6 1

예제 출력 1

1

예제 입력 2

6
0 1
2 0
3 -2
3 2
7 1
2 4

예제 출력 2

6

힌트

출처

ICPC > Regionals > Asia Pacific > Korea > Nationwide Internet Competition > Seoul Nationalwide Internet Competition 2021 L번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /