結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
kutsutama
|
| 提出日時 | 2018-12-16 03:14:20 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 99 ms / 2,000 ms |
| コード長 | 216 bytes |
| 記録 | |
| コンパイル時間 | 559 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-03-27 01:30:56 |
| 合計ジャッジ時間 | 4,724 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
n, m = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
c.sort()
res = 0
candy = 0
for ci in c:
candy += ci
if candy <= m:
res += 1
if candy >= m:
break
print(res)
kutsutama