結果

問題 No.1374 Absolute Game
ユーザー maguroflymagurofly
提出日時 2021-02-06 05:21:50
言語 Ruby
(3.3.0)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 137 bytes
コンパイル時間 43 ms
コンパイル使用メモリ 11,564 KB
実行使用メモリ 26,104 KB
最終ジャッジ日時 2023-09-15 11:23:17
合計ジャッジ時間 4,587 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,232 KB
testcase_01 AC 79 ms
15,328 KB
testcase_02 AC 80 ms
15,096 KB
testcase_03 AC 79 ms
15,236 KB
testcase_04 AC 82 ms
15,128 KB
testcase_05 AC 80 ms
15,228 KB
testcase_06 AC 83 ms
15,292 KB
testcase_07 AC 78 ms
15,320 KB
testcase_08 AC 101 ms
18,144 KB
testcase_09 AC 137 ms
21,660 KB
testcase_10 AC 145 ms
22,064 KB
testcase_11 AC 120 ms
20,620 KB
testcase_12 AC 104 ms
18,232 KB
testcase_13 AC 130 ms
21,356 KB
testcase_14 AC 158 ms
26,104 KB
testcase_15 AC 159 ms
25,912 KB
testcase_16 AC 156 ms
26,008 KB
testcase_17 AC 159 ms
25,872 KB
testcase_18 AC 159 ms
25,940 KB
testcase_19 AC 157 ms
25,844 KB
testcase_20 AC 110 ms
18,348 KB
testcase_21 AC 123 ms
20,704 KB
testcase_22 AC 155 ms
26,012 KB
testcase_23 AC 87 ms
15,760 KB
testcase_24 AC 93 ms
16,308 KB
testcase_25 AC 93 ms
16,592 KB
testcase_26 AC 107 ms
18,148 KB
testcase_27 AC 114 ms
19,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
c = gets.split.map(&:to_i).sort

a = 0
b = 0
c.reverse_each do |x|
    a += x
    a, b = b, a
end

puts (b.abs - a.abs).abs
0