結果

問題 No.609 Noelちゃんと星々
ユーザー kryu_______2740kryu_______2740
提出日時 2018-02-22 14:42:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 23,532 KB
最終ジャッジ日時 2024-04-08 16:50:59
合計ジャッジ時間 3,939 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
20,932 KB
testcase_01 AC 80 ms
16,748 KB
testcase_02 AC 70 ms
15,500 KB
testcase_03 AC 79 ms
16,540 KB
testcase_04 AC 62 ms
14,336 KB
testcase_05 AC 128 ms
22,864 KB
testcase_06 AC 116 ms
21,416 KB
testcase_07 AC 88 ms
17,812 KB
testcase_08 AC 55 ms
13,568 KB
testcase_09 AC 73 ms
15,924 KB
testcase_10 AC 97 ms
19,140 KB
testcase_11 AC 93 ms
18,588 KB
testcase_12 AC 108 ms
20,264 KB
testcase_13 AC 57 ms
13,952 KB
testcase_14 AC 51 ms
13,184 KB
testcase_15 AC 117 ms
21,688 KB
testcase_16 AC 134 ms
23,196 KB
testcase_17 AC 113 ms
20,944 KB
testcase_18 AC 68 ms
15,336 KB
testcase_19 AC 116 ms
21,420 KB
testcase_20 AC 135 ms
23,532 KB
testcase_21 AC 136 ms
23,532 KB
testcase_22 AC 137 ms
23,532 KB
testcase_23 AC 135 ms
23,532 KB
testcase_24 AC 134 ms
23,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import statistics as st

N = int(input())
Y = list(map(int,input().split()))

#中央値の算出~距離を算出
median = 0.
distance = 0

median = st.median(Y)
for i in range(N):
    distance = distance + abs(median-Y[i])
print(int(distance))
0