結果

問題 No.156 キャンディー・ボックス
ユーザー minezumu
提出日時 2018-07-23 09:19:26
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 236 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-12-26 05:35:31
合計ジャッジ時間 2,402 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 14 RE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
C = list(map(int,input().split()))
C = sorted(C)
counter = 0
answer = 0
for i in range(M) :
    if C[i] <= M - counter :
        counter += C[i]
        answer += 1
    else :
        break
print(answer)

0