結果

問題 No.609 Noelちゃんと星々
ユーザー RyutoRyuto
提出日時 2017-12-11 13:15:42
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 21,444 KB
最終ジャッジ日時 2023-08-20 10:06:18
合計ジャッジ時間 3,895 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
18,616 KB
testcase_01 AC 58 ms
14,996 KB
testcase_02 AC 52 ms
13,576 KB
testcase_03 AC 57 ms
14,956 KB
testcase_04 AC 44 ms
12,460 KB
testcase_05 AC 97 ms
20,724 KB
testcase_06 AC 89 ms
19,204 KB
testcase_07 AC 65 ms
15,572 KB
testcase_08 AC 39 ms
11,272 KB
testcase_09 AC 53 ms
13,604 KB
testcase_10 AC 72 ms
17,064 KB
testcase_11 AC 70 ms
16,120 KB
testcase_12 AC 79 ms
18,120 KB
testcase_13 AC 40 ms
11,832 KB
testcase_14 AC 35 ms
10,756 KB
testcase_15 AC 89 ms
19,200 KB
testcase_16 AC 100 ms
20,896 KB
testcase_17 AC 83 ms
18,484 KB
testcase_18 AC 49 ms
13,544 KB
testcase_19 AC 87 ms
19,328 KB
testcase_20 AC 102 ms
21,444 KB
testcase_21 AC 102 ms
21,200 KB
testcase_22 AC 102 ms
21,404 KB
testcase_23 AC 102 ms
21,240 KB
testcase_24 AC 101 ms
21,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python

import statistics

n = int(input().strip())
indat = [int(x) for x in input().split()]

median = statistics.median(indat)
median = round(median)
diff = [abs(median - x) for x in indat]

print(sum(diff))
0