結果

問題 No.609 Noelちゃんと星々
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2020-02-19 18:28:22
言語 Ruby
(3.3.0)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 101 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 20,992 KB
最終ジャッジ日時 2024-04-17 01:53:16
合計ジャッジ時間 4,881 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
18,560 KB
testcase_01 AC 100 ms
15,360 KB
testcase_02 AC 96 ms
14,080 KB
testcase_03 AC 106 ms
14,848 KB
testcase_04 AC 92 ms
13,440 KB
testcase_05 AC 142 ms
20,352 KB
testcase_06 AC 139 ms
18,816 KB
testcase_07 AC 115 ms
16,000 KB
testcase_08 AC 89 ms
12,800 KB
testcase_09 AC 99 ms
14,592 KB
testcase_10 AC 117 ms
17,408 KB
testcase_11 AC 110 ms
16,640 KB
testcase_12 AC 137 ms
17,920 KB
testcase_13 AC 84 ms
12,928 KB
testcase_14 AC 78 ms
12,416 KB
testcase_15 AC 126 ms
18,816 KB
testcase_16 AC 138 ms
20,736 KB
testcase_17 AC 126 ms
18,432 KB
testcase_18 AC 92 ms
14,208 KB
testcase_19 AC 124 ms
18,816 KB
testcase_20 AC 136 ms
20,864 KB
testcase_21 AC 136 ms
20,992 KB
testcase_22 AC 142 ms
20,864 KB
testcase_23 AC 139 ms
20,992 KB
testcase_24 AC 138 ms
20,992 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
Y = gets.split.map(&:to_i).sort
y_ = Y[N/2]
puts Y.inject(0){|s, y| s + (y - y_).abs }
0