結果

問題 No.156 キャンディー・ボックス
ユーザー a_tena_ten
提出日時 2016-03-23 21:37:11
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 192 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 21:11:34
合計ジャッジ時間 1,635 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,812 KB
testcase_01 WA -
testcase_02 AC 9 ms
6,944 KB
testcase_03 AC 10 ms
6,944 KB
testcase_04 RE -
testcase_05 WA -
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 WA -
testcase_19 AC 9 ms
6,944 KB
testcase_20 AC 10 ms
6,940 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 10 ms
6,940 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 9 ms
6,940 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 10 ms
6,944 KB
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding:utf-8

N,M=map(int,raw_input().split())
C=map(int,raw_input().split())

sorted(C)

cnt=0
while 0 < M:
	for i in range(N):
		M-=C[i]
		cnt+=1
		if M < C[i+1]:
			break
	break

print cnt
0