結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-04 22:04:48 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 99 ms / 2,000 ms |
| コード長 | 297 bytes |
| 記録 | |
| コンパイル時間 | 1,014 ms |
| コンパイル使用メモリ | 20,832 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-06-03 14:50:36 |
| 合計ジャッジ時間 | 5,725 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
n,m = map(int,input().split())
boxes = list(map(int,input().split()))
boxes.sort()
for j in range(len(boxes)):
if boxes[j] != 0 and boxes[j] <= m:
m -= boxes[j]
boxes[j]=0
if boxes[j] != 0 and boxes[j] >= m:
boxes[j] -= m
m=0
print(boxes.count(0))