結果

問題 No.609 Noelちゃんと星々
ユーザー tails1434tails1434
提出日時 2020-02-12 07:32:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 82,832 KB
実行使用メモリ 104,784 KB
最終ジャッジ日時 2024-04-10 08:14:44
合計ジャッジ時間 5,600 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 174 ms
100,736 KB
testcase_01 AC 156 ms
92,716 KB
testcase_02 AC 156 ms
90,752 KB
testcase_03 AC 153 ms
92,228 KB
testcase_04 AC 146 ms
89,184 KB
testcase_05 AC 179 ms
104,456 KB
testcase_06 AC 171 ms
100,864 KB
testcase_07 AC 165 ms
94,848 KB
testcase_08 AC 149 ms
88,832 KB
testcase_09 AC 152 ms
91,484 KB
testcase_10 AC 164 ms
97,372 KB
testcase_11 AC 162 ms
96,256 KB
testcase_12 AC 168 ms
99,228 KB
testcase_13 AC 146 ms
89,088 KB
testcase_14 AC 145 ms
89,072 KB
testcase_15 AC 174 ms
102,400 KB
testcase_16 AC 183 ms
104,528 KB
testcase_17 AC 172 ms
100,484 KB
testcase_18 AC 150 ms
90,752 KB
testcase_19 AC 175 ms
101,120 KB
testcase_20 AC 181 ms
104,704 KB
testcase_21 AC 179 ms
104,704 KB
testcase_22 AC 184 ms
104,576 KB
testcase_23 AC 180 ms
104,784 KB
testcase_24 AC 186 ms
104,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import statistics
import math

def main():
    N = int(input())
    Y = list(map(int, input().split()))
    median = statistics.median_low(Y)
    ans = 0
    for i in range(N):
        ans += abs(Y[i] - median)

    print(ans)



if __name__ == "__main__":
    main()
0