結果

問題 No.609 Noelちゃんと星々
ユーザー htkbhtkb
提出日時 2018-04-21 08:51:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 102 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 10,428 KB
実行使用メモリ 18,928 KB
最終ジャッジ日時 2023-09-09 12:17:40
合計ジャッジ時間 3,606 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
16,216 KB
testcase_01 AC 38 ms
12,224 KB
testcase_02 AC 30 ms
10,792 KB
testcase_03 AC 36 ms
11,828 KB
testcase_04 AC 25 ms
9,840 KB
testcase_05 AC 75 ms
18,356 KB
testcase_06 AC 65 ms
16,840 KB
testcase_07 AC 44 ms
13,252 KB
testcase_08 AC 20 ms
9,260 KB
testcase_09 AC 33 ms
11,220 KB
testcase_10 AC 51 ms
14,488 KB
testcase_11 AC 49 ms
14,144 KB
testcase_12 AC 59 ms
15,592 KB
testcase_13 AC 22 ms
9,424 KB
testcase_14 AC 18 ms
8,700 KB
testcase_15 AC 68 ms
17,052 KB
testcase_16 AC 77 ms
18,660 KB
testcase_17 AC 63 ms
16,400 KB
testcase_18 AC 30 ms
10,616 KB
testcase_19 AC 67 ms
16,884 KB
testcase_20 AC 78 ms
18,740 KB
testcase_21 AC 78 ms
18,928 KB
testcase_22 AC 77 ms
18,852 KB
testcase_23 AC 77 ms
18,884 KB
testcase_24 AC 78 ms
18,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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