結果

問題 No.1447 Greedy MtSaka
ユーザー maguroflymagurofly
提出日時 2021-03-31 16:16:37
言語 Ruby
(3.3.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2023-08-21 14:38:40
合計ジャッジ時間 4,018 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,228 KB
testcase_01 AC 79 ms
15,112 KB
testcase_02 AC 77 ms
15,148 KB
testcase_03 AC 78 ms
15,048 KB
testcase_04 AC 76 ms
15,356 KB
testcase_05 AC 78 ms
15,224 KB
testcase_06 AC 77 ms
15,288 KB
testcase_07 AC 76 ms
15,128 KB
testcase_08 AC 75 ms
15,144 KB
testcase_09 AC 75 ms
15,108 KB
testcase_10 AC 77 ms
15,224 KB
testcase_11 AC 78 ms
15,284 KB
testcase_12 AC 78 ms
15,044 KB
testcase_13 AC 75 ms
15,232 KB
testcase_14 AC 77 ms
15,240 KB
testcase_15 AC 77 ms
15,308 KB
testcase_16 AC 77 ms
15,120 KB
testcase_17 AC 75 ms
15,160 KB
testcase_18 AC 76 ms
15,296 KB
testcase_19 AC 75 ms
15,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
pos = Array.new(N) { gets.split.map(&:to_i) }

def polygon_area_times2(pos)
  (0 ... pos.size).sum { |i| pos[i][0] * pos[i - 1][1] - pos[i][1] * pos[i - 1][0] }.abs
end

puts polygon_area_times2(pos)
0