結果

問題 No.156 キャンディー・ボックス
ユーザー bellangeldindonbellangeldindon
提出日時 2019-05-07 17:16:33
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 171 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 6,696 KB
実行使用メモリ 6,080 KB
最終ジャッジ日時 2023-09-14 16:27:24
合計ジャッジ時間 2,587 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,860 KB
testcase_01 AC 12 ms
5,900 KB
testcase_02 AC 12 ms
5,864 KB
testcase_03 AC 12 ms
5,904 KB
testcase_04 RE -
testcase_05 AC 11 ms
5,864 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 11 ms
6,052 KB
testcase_19 AC 11 ms
5,952 KB
testcase_20 AC 12 ms
5,928 KB
testcase_21 AC 11 ms
5,952 KB
testcase_22 AC 11 ms
6,032 KB
testcase_23 AC 11 ms
5,964 KB
testcase_24 AC 11 ms
5,944 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 11 ms
6,068 KB
testcase_29 AC 11 ms
5,864 KB
testcase_30 AC 12 ms
5,932 KB
testcase_31 AC 11 ms
6,040 KB
testcase_32 AC 11 ms
5,948 KB
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

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