結果

問題 No.156 キャンディー・ボックス
ユーザー minezumuminezumu
提出日時 2018-07-23 08:46:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 308 bytes
コンパイル時間 864 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 12,668 KB
最終ジャッジ日時 2023-08-27 01:09:33
合計ジャッジ時間 11,552 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
7,656 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 15 ms
7,792 KB
testcase_03 AC 16 ms
7,740 KB
testcase_04 AC 15 ms
7,836 KB
testcase_05 AC 206 ms
7,832 KB
testcase_06 AC 440 ms
7,776 KB
testcase_07 AC 336 ms
7,912 KB
testcase_08 AC 285 ms
7,660 KB
testcase_09 AC 211 ms
7,736 KB
testcase_10 AC 338 ms
7,740 KB
testcase_11 AC 194 ms
7,836 KB
testcase_12 AC 416 ms
7,660 KB
testcase_13 AC 277 ms
7,760 KB
testcase_14 AC 195 ms
7,776 KB
testcase_15 AC 320 ms
7,900 KB
testcase_16 AC 213 ms
7,828 KB
testcase_17 AC 285 ms
7,748 KB
testcase_18 AC 107 ms
7,792 KB
testcase_19 AC 121 ms
7,752 KB
testcase_20 AC 24 ms
7,832 KB
testcase_21 AC 42 ms
7,836 KB
testcase_22 AC 98 ms
7,784 KB
testcase_23 AC 56 ms
7,656 KB
testcase_24 AC 16 ms
7,964 KB
testcase_25 AC 15 ms
7,964 KB
testcase_26 AC 16 ms
7,724 KB
testcase_27 AC 17 ms
7,836 KB
testcase_28 AC 16 ms
7,876 KB
testcase_29 AC 16 ms
7,740 KB
testcase_30 AC 1,203 ms
7,720 KB
testcase_31 AC 363 ms
7,720 KB
testcase_32 TLE -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
C = list(map(int,input().split()))
C = sorted(C)
counter = 0
answer = 0
while counter < M+1 :
    if len(C) == 0 :
        break
    elif C[0] != 0 :
        C[0] -= 1
        counter += 1
        C = sorted(C)
    else :
        answer += 1
        C.pop(C[0])
print(answer)

0