結果

問題 No.609 Noelちゃんと星々
ユーザー ysys
提出日時 2018-01-22 18:50:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 137 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 10,548 KB
実行使用メモリ 18,932 KB
最終ジャッジ日時 2023-08-26 21:58:51
合計ジャッジ時間 3,905 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
16,312 KB
testcase_01 AC 43 ms
12,344 KB
testcase_02 AC 34 ms
10,892 KB
testcase_03 AC 41 ms
11,860 KB
testcase_04 AC 27 ms
9,808 KB
testcase_05 AC 87 ms
18,404 KB
testcase_06 AC 77 ms
16,916 KB
testcase_07 AC 51 ms
13,340 KB
testcase_08 AC 21 ms
9,184 KB
testcase_09 AC 37 ms
11,240 KB
testcase_10 AC 60 ms
14,476 KB
testcase_11 AC 59 ms
14,148 KB
testcase_12 AC 70 ms
15,792 KB
testcase_13 AC 24 ms
9,580 KB
testcase_14 AC 18 ms
8,660 KB
testcase_15 AC 80 ms
17,220 KB
testcase_16 AC 90 ms
18,608 KB
testcase_17 AC 74 ms
16,292 KB
testcase_18 AC 34 ms
11,000 KB
testcase_19 AC 79 ms
16,876 KB
testcase_20 AC 93 ms
18,812 KB
testcase_21 AC 94 ms
18,796 KB
testcase_22 AC 93 ms
18,884 KB
testcase_23 AC 94 ms
18,880 KB
testcase_24 AC 94 ms
18,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
y = list(map(int, input().split()))
y = sorted(y)
mid = y[N // 2]
num = 0
for k in y:
    num += abs(k - mid)
print(num)
0