結果

問題 No.198 キャンディー・ボックス2
ユーザー mlihua09mlihua09
提出日時 2020-09-21 11:14:46
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 257 ms / 1,000 ms
コード長 183 bytes
コンパイル時間 850 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 85,620 KB
最終ジャッジ日時 2023-09-06 17:02:10
合計ジャッジ時間 10,440 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 250 ms
85,444 KB
testcase_01 AC 249 ms
85,284 KB
testcase_02 AC 251 ms
85,440 KB
testcase_03 AC 257 ms
85,520 KB
testcase_04 AC 256 ms
85,324 KB
testcase_05 AC 256 ms
85,620 KB
testcase_06 AC 250 ms
85,284 KB
testcase_07 AC 251 ms
85,572 KB
testcase_08 AC 253 ms
85,272 KB
testcase_09 AC 251 ms
85,344 KB
testcase_10 AC 255 ms
85,288 KB
testcase_11 AC 254 ms
85,364 KB
testcase_12 AC 252 ms
85,064 KB
testcase_13 AC 249 ms
85,440 KB
testcase_14 AC 254 ms
85,488 KB
testcase_15 AC 252 ms
85,392 KB
testcase_16 AC 253 ms
85,116 KB
testcase_17 AC 251 ms
85,332 KB
testcase_18 AC 251 ms
85,296 KB
testcase_19 AC 252 ms
85,280 KB
testcase_20 AC 253 ms
85,452 KB
testcase_21 AC 253 ms
85,496 KB
testcase_22 AC 253 ms
85,312 KB
testcase_23 AC 250 ms
85,436 KB
testcase_24 AC 252 ms
85,268 KB
testcase_25 AC 252 ms
85,260 KB
testcase_26 AC 249 ms
85,372 KB
testcase_27 AC 252 ms
85,280 KB
testcase_28 AC 253 ms
85,580 KB
testcase_29 AC 255 ms
85,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


B = int(input())

N = int(input())

C = [int(input()) for i in range(N)]

import statistics
x = min(statistics.median_low(C), (sum(C) + B) // N)

print(sum([abs(c - x) for c in C]))
0