結果

問題 No.156 キャンディー・ボックス
ユーザー shamio
提出日時 2020-06-01 19:02:02
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-22 05:04:29
合計ジャッジ時間 2,423 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
c = list(map(int, input().split()))

c.sort()
i = 0
cnt = 0
while i < n and m - c[i] >= 0:
    cnt += 1
    m -= c[i]
    i += 1

print(cnt)
0