結果
| 問題 | 
                            No.156 キャンディー・ボックス
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-02-05 22:41:31 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 219 bytes | 
| コンパイル時間 | 146 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-07-08 07:25:18 | 
| 合計ジャッジ時間 | 1,783 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 WA * 1 | 
| other | AC * 14 WA * 16 | 
ソースコード
# coding: utf-8
n,m = map(int, input().split(" "))
candys = list(map(int,input().split(" ")))
candys = sorted(candys)
res = 0
for i in range(n):
    m -= candys[i]
    if m < 0:
        res = i
        break
print(res)