結果

問題 No.609 Noelちゃんと星々
ユーザー RyutoRyuto
提出日時 2017-12-11 13:15:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 24,496 KB
最終ジャッジ日時 2024-05-07 17:06:56
合計ジャッジ時間 4,001 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
21,780 KB
testcase_01 AC 75 ms
17,996 KB
testcase_02 AC 68 ms
16,756 KB
testcase_03 AC 73 ms
18,052 KB
testcase_04 AC 61 ms
15,744 KB
testcase_05 AC 118 ms
23,700 KB
testcase_06 AC 107 ms
22,400 KB
testcase_07 AC 83 ms
18,672 KB
testcase_08 AC 52 ms
14,592 KB
testcase_09 AC 69 ms
16,804 KB
testcase_10 AC 94 ms
20,008 KB
testcase_11 AC 93 ms
19,448 KB
testcase_12 AC 104 ms
20,992 KB
testcase_13 AC 58 ms
15,232 KB
testcase_14 AC 52 ms
14,208 KB
testcase_15 AC 109 ms
22,548 KB
testcase_16 AC 126 ms
24,044 KB
testcase_17 AC 105 ms
21,808 KB
testcase_18 AC 65 ms
16,596 KB
testcase_19 AC 110 ms
22,396 KB
testcase_20 AC 123 ms
24,496 KB
testcase_21 AC 123 ms
24,372 KB
testcase_22 AC 122 ms
24,496 KB
testcase_23 AC 121 ms
24,376 KB
testcase_24 AC 125 ms
24,372 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