問題一覧 > 通常問題

No.1447 Greedy MtSaka

レベル : / AI推定難易度 : 204 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 157
作問者 : MtSaka / テスター : butsurizuki
お気に入りにしたユーザー ProblemId : 6081 / 自分の提出
問題文最終更新日: 2021-04-01 19:18:01
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
新入生プログラミングコンテスト 2021(昼の部) (順位表) の他の問題:

Problem Statement

MtSaka is currently in a territorial dispute. In it, he managed to occupy $N$ points.
He will rule the interior of the $N$-gon formed by connecting those points.
Given the coordinates of all $N$ points, find $2$ times the area he rules.
Note that the answer is always an integer. It is also guaranteed that the polygon formed by connecting the points in the order given in the input is a convex polygon, and that the points are given in counterclockwise order.

Input

$N$
$X_1\ Y_1$
$X_2\ Y_2$
$\vdots$
$X_N\ Y_N$

Constraints

・$3 \leq N \leq 30$
・$-10000 \leq X_i,Y_i \leq 10000 (1 \leq i \leq N)$
・All input values are integers
・The input satisfies the conditions in the problem statement

Output

Output $2$ times the area of the $N$-gon ruled by MtSaka, as a single positive integer on one line. Print a newline at the end.

Sample

Sample 1
Input
3
1 0
1 1
0 1
Output
1

Isn't that too small?

Sample 2
Input
7
-1 -1
2 -1
2 3
1 5
0 6
-1 5
-2 3
Output
42

Sample 3
Input
6
4 1
9 1
11 4
9 9
7 8
5 5
Output
72

What a complicated shape...

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。