結果

問題 No.1374 Absolute Game
ユーザー maguroflymagurofly
提出日時 2021-02-06 05:21:34
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 131 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 11,456 KB
実行使用メモリ 26,068 KB
最終ジャッジ日時 2023-09-15 11:23:06
合計ジャッジ時間 5,451 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,064 KB
testcase_01 AC 78 ms
15,120 KB
testcase_02 AC 81 ms
15,020 KB
testcase_03 AC 78 ms
15,304 KB
testcase_04 AC 78 ms
15,052 KB
testcase_05 WA -
testcase_06 AC 79 ms
15,332 KB
testcase_07 WA -
testcase_08 AC 102 ms
18,008 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 120 ms
20,672 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 159 ms
25,832 KB
testcase_16 WA -
testcase_17 AC 159 ms
25,904 KB
testcase_18 WA -
testcase_19 AC 159 ms
25,872 KB
testcase_20 AC 106 ms
18,344 KB
testcase_21 AC 117 ms
20,568 KB
testcase_22 AC 155 ms
25,784 KB
testcase_23 AC 86 ms
15,704 KB
testcase_24 WA -
testcase_25 AC 91 ms
16,616 KB
testcase_26 AC 106 ms
18,256 KB
testcase_27 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
0