結果

問題 No.1447 Greedy MtSaka
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-03-31 17:41:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-15 05:27:27
合計ジャッジ時間 1,538 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]
xy = xy + [xy[0]]
ans = 0
for i in range(n):
    x1, y1 = xy[i]
    x2, y2 = xy[i + 1]
    ans += x1 * y2 - x2 * y1
print(abs(ans))
0