結果

問題 No.609 Noelちゃんと星々
ユーザー pluto77pluto77
提出日時 2017-12-09 09:49:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 164 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 24,376 KB
最終ジャッジ日時 2024-05-07 10:24:08
合計ジャッジ時間 4,410 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
21,776 KB
testcase_01 AC 91 ms
17,480 KB
testcase_02 AC 77 ms
16,368 KB
testcase_03 AC 84 ms
17,276 KB
testcase_04 AC 66 ms
15,104 KB
testcase_05 AC 150 ms
23,576 KB
testcase_06 AC 135 ms
22,264 KB
testcase_07 AC 97 ms
18,668 KB
testcase_08 AC 59 ms
14,336 KB
testcase_09 AC 77 ms
16,788 KB
testcase_10 AC 110 ms
20,000 KB
testcase_11 AC 107 ms
19,320 KB
testcase_12 AC 123 ms
20,992 KB
testcase_13 AC 62 ms
14,848 KB
testcase_14 AC 54 ms
14,080 KB
testcase_15 AC 139 ms
22,408 KB
testcase_16 AC 151 ms
24,036 KB
testcase_17 AC 127 ms
21,796 KB
testcase_18 AC 75 ms
16,072 KB
testcase_19 AC 134 ms
22,268 KB
testcase_20 AC 155 ms
24,368 KB
testcase_21 AC 153 ms
24,368 KB
testcase_22 AC 156 ms
24,372 KB
testcase_23 AC 160 ms
24,376 KB
testcase_24 AC 156 ms
24,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_609
from statistics import median

n=int(input())
y=list(map(int,input().split()))
med=median(y)
res=0
for i in range(n):
 res+=abs(y[i]-int(med))
print(res)
0