結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
15,896 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 15 ms
7,736 KB
testcase_03 AC 14 ms
7,820 KB
testcase_04 AC 16 ms
7,848 KB
testcase_05 AC 202 ms
7,804 KB
testcase_06 AC 419 ms
7,820 KB
testcase_07 AC 330 ms
7,956 KB
testcase_08 AC 278 ms
7,820 KB
testcase_09 AC 202 ms
7,852 KB
testcase_10 AC 329 ms
7,808 KB
testcase_11 AC 187 ms
7,968 KB
testcase_12 AC 395 ms
7,776 KB
testcase_13 AC 274 ms
7,884 KB
testcase_14 AC 188 ms
7,968 KB
testcase_15 AC 309 ms
7,748 KB
testcase_16 AC 208 ms
7,876 KB
testcase_17 AC 270 ms
7,820 KB
testcase_18 AC 103 ms
7,800 KB
testcase_19 AC 120 ms
7,908 KB
testcase_20 AC 24 ms
7,816 KB
testcase_21 AC 42 ms
7,872 KB
testcase_22 AC 96 ms
7,916 KB
testcase_23 AC 55 ms
7,856 KB
testcase_24 AC 15 ms
7,916 KB
testcase_25 AC 14 ms
7,732 KB
testcase_26 AC 15 ms
7,800 KB
testcase_27 AC 15 ms
7,824 KB
testcase_28 AC 15 ms
8,012 KB
testcase_29 AC 15 ms
7,804 KB
testcase_30 AC 1,143 ms
7,812 KB
testcase_31 AC 348 ms
7,804 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