結果

問題 No.198 キャンディー・ボックス2
ユーザー hiragnhiragn
提出日時 2022-11-18 23:35:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 251 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 64,976 KB
最終ジャッジ日時 2023-10-20 08:31:54
合計ジャッジ時間 19,062 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 461 ms
42,596 KB
testcase_02 AC 469 ms
42,596 KB
testcase_03 AC 467 ms
42,592 KB
testcase_04 AC 469 ms
42,592 KB
testcase_05 AC 463 ms
42,592 KB
testcase_06 AC 472 ms
42,592 KB
testcase_07 AC 459 ms
42,592 KB
testcase_08 AC 462 ms
42,592 KB
testcase_09 AC 470 ms
42,596 KB
testcase_10 AC 456 ms
42,596 KB
testcase_11 AC 460 ms
42,596 KB
testcase_12 AC 471 ms
42,596 KB
testcase_13 AC 465 ms
42,596 KB
testcase_14 AC 459 ms
42,596 KB
testcase_15 AC 461 ms
42,592 KB
testcase_16 AC 461 ms
42,596 KB
testcase_17 AC 458 ms
42,592 KB
testcase_18 AC 460 ms
42,592 KB
testcase_19 WA -
testcase_20 AC 457 ms
42,596 KB
testcase_21 WA -
testcase_22 AC 454 ms
42,592 KB
testcase_23 WA -
testcase_24 AC 463 ms
42,592 KB
testcase_25 WA -
testcase_26 AC 463 ms
42,596 KB
testcase_27 AC 474 ms
42,592 KB
testcase_28 WA -
testcase_29 AC 475 ms
64,976 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