結果

問題 No.156 キャンディー・ボックス
ユーザー bellangeldindon
提出日時 2019-05-07 17:16:33
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 171 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-01 23:34:35
合計ジャッジ時間 1,700 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 14 RE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, raw_input().split())
candy = map(int, raw_input().split())
candy.sort()
cnt = 0
while(True):
	if M < candy[0]: break
	M -= candy.pop(0)
	cnt += 1
print cnt
0