結果

問題 No.609 Noelちゃんと星々
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-12-17 14:55:46
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 10,512 KB
実行使用メモリ 21,412 KB
最終ジャッジ日時 2023-08-22 04:23:37
合計ジャッジ時間 3,816 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
18,480 KB
testcase_01 AC 56 ms
14,444 KB
testcase_02 AC 46 ms
13,144 KB
testcase_03 AC 53 ms
14,416 KB
testcase_04 AC 42 ms
11,892 KB
testcase_05 AC 92 ms
20,684 KB
testcase_06 AC 83 ms
19,056 KB
testcase_07 AC 60 ms
15,384 KB
testcase_08 AC 36 ms
11,356 KB
testcase_09 AC 49 ms
13,440 KB
testcase_10 AC 67 ms
16,804 KB
testcase_11 AC 66 ms
16,148 KB
testcase_12 AC 74 ms
18,104 KB
testcase_13 AC 38 ms
11,536 KB
testcase_14 AC 33 ms
10,728 KB
testcase_15 AC 84 ms
19,372 KB
testcase_16 AC 92 ms
20,664 KB
testcase_17 AC 79 ms
18,504 KB
testcase_18 AC 46 ms
13,196 KB
testcase_19 AC 81 ms
19,112 KB
testcase_20 AC 94 ms
21,332 KB
testcase_21 AC 93 ms
21,304 KB
testcase_22 AC 93 ms
21,284 KB
testcase_23 AC 93 ms
21,412 KB
testcase_24 AC 93 ms
21,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3


import statistics


def compute_min_sum_delta(n, ys):
    m = statistics.median(ys)
    return round(sum(abs(y - m) for y in ys))


def main():
    n = int(input())
    ys = [int(y) for y in input().split()]
    print(compute_min_sum_delta(n, ys))


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