結果

問題 No.198 キャンディー・ボックス2
ユーザー 👑 hiragnhiragn
提出日時 2022-11-18 23:35:34
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
WA  
実行時間 -
コード長 251 bytes
コンパイル時間 785 ms
使用メモリ 28,788 KB
最終ジャッジ日時 2023-03-28 13:58:18
合計ジャッジ時間 9,120 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 133 ms
28,628 KB
testcase_01 AC 131 ms
28,624 KB
testcase_02 AC 134 ms
28,708 KB
testcase_03 AC 137 ms
28,640 KB
testcase_04 AC 134 ms
28,476 KB
testcase_05 AC 133 ms
28,464 KB
testcase_06 AC 132 ms
28,788 KB
testcase_07 AC 133 ms
28,484 KB
testcase_08 AC 136 ms
28,700 KB
testcase_09 AC 134 ms
28,592 KB
testcase_10 AC 135 ms
28,560 KB
testcase_11 AC 134 ms
28,548 KB
testcase_12 AC 135 ms
28,416 KB
testcase_13 AC 133 ms
28,704 KB
testcase_14 AC 134 ms
28,388 KB
testcase_15 AC 136 ms
28,360 KB
testcase_16 AC 134 ms
28,464 KB
testcase_17 AC 135 ms
28,420 KB
testcase_18 AC 134 ms
28,760 KB
testcase_19 WA -
testcase_20 AC 133 ms
28,644 KB
testcase_21 WA -
testcase_22 AC 136 ms
28,748 KB
testcase_23 WA -
testcase_24 AC 134 ms
28,644 KB
testcase_25 WA -
testcase_26 AC 135 ms
28,568 KB
testcase_27 AC 135 ms
28,484 KB
testcase_28 WA -
testcase_29 AC 135 ms
28,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np


def main():
    _ = int(input())
    n = int(input())
    c = np.array([int(input()) for _ in range(n)])
    med = int(np.median(c))

    ans = sum([abs(x - med) for x in c])
    print(ans)


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