結果

問題 No.609 Noelちゃんと星々
ユーザー simansiman
提出日時 2020-11-23 19:39:30
言語 Ruby
(3.3.0)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 95 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 11,452 KB
実行使用メモリ 23,820 KB
最終ジャッジ日時 2023-10-01 00:00:08
合計ジャッジ時間 5,023 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
21,520 KB
testcase_01 AC 105 ms
18,080 KB
testcase_02 AC 95 ms
17,096 KB
testcase_03 AC 108 ms
18,016 KB
testcase_04 AC 90 ms
16,508 KB
testcase_05 AC 141 ms
23,020 KB
testcase_06 AC 131 ms
21,956 KB
testcase_07 AC 111 ms
19,124 KB
testcase_08 AC 85 ms
15,812 KB
testcase_09 AC 101 ms
17,488 KB
testcase_10 AC 118 ms
20,144 KB
testcase_11 AC 115 ms
19,500 KB
testcase_12 AC 124 ms
21,060 KB
testcase_13 AC 87 ms
15,904 KB
testcase_14 AC 83 ms
15,324 KB
testcase_15 AC 133 ms
21,768 KB
testcase_16 AC 147 ms
23,384 KB
testcase_17 AC 127 ms
21,676 KB
testcase_18 AC 98 ms
17,104 KB
testcase_19 AC 128 ms
21,900 KB
testcase_20 AC 145 ms
23,800 KB
testcase_21 AC 146 ms
23,820 KB
testcase_22 AC 145 ms
23,632 KB
testcase_23 AC 145 ms
23,752 KB
testcase_24 AC 144 ms
23,536 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
Y = gets.split.map(&:to_i)
X = Y.sort[N / 2]

puts Y.map { |y| (y - X).abs }.sum
0