結果

問題 No.1447 Greedy MtSaka
ユーザー 👑 rin204
提出日時 2021-08-23 05:25:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-11-07 05:03:27
合計ジャッジ時間 2,075 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

ans = 0
x0, y0 = xy[0]
for i in range(1, n - 1):
    x1, y1 = xy[i]
    x2, y2 = xy[i + 1]
    dx1 = x1 - x0
    dy1 = y1 - y0
    dx2 = x2 - x0
    dy2 = y2 - y0
    ans += abs(dx1 * dy2 - dy1 * dx2)
print(ans)

0