結果

問題 No.609 Noelちゃんと星々
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-12-06 22:45:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 122 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 11,744 KB
実行使用メモリ 20,816 KB
最終ジャッジ日時 2023-10-17 15:40:19
合計ジャッジ時間 4,141 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
18,320 KB
testcase_01 AC 51 ms
14,092 KB
testcase_02 AC 42 ms
12,976 KB
testcase_03 AC 52 ms
13,892 KB
testcase_04 AC 37 ms
11,828 KB
testcase_05 AC 89 ms
20,412 KB
testcase_06 AC 80 ms
18,948 KB
testcase_07 AC 57 ms
15,304 KB
testcase_08 AC 33 ms
11,188 KB
testcase_09 AC 46 ms
13,268 KB
testcase_10 AC 65 ms
16,392 KB
testcase_11 AC 62 ms
16,088 KB
testcase_12 AC 72 ms
17,652 KB
testcase_13 AC 34 ms
11,508 KB
testcase_14 AC 30 ms
10,676 KB
testcase_15 AC 81 ms
19,096 KB
testcase_16 AC 91 ms
20,616 KB
testcase_17 AC 76 ms
18,344 KB
testcase_18 AC 42 ms
12,936 KB
testcase_19 AC 80 ms
18,952 KB
testcase_20 AC 92 ms
20,816 KB
testcase_21 AC 93 ms
20,816 KB
testcase_22 AC 92 ms
20,816 KB
testcase_23 AC 93 ms
20,816 KB
testcase_24 AC 93 ms
20,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = sorted(list(map(int, input().split())))
med = a[n // 2]
ans = sum(abs(med - i) for i in a)
print(ans)
0