結果

問題 No.156 キャンディー・ボックス
ユーザー miya145592
提出日時 2023-05-03 18:42:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-11-21 20:12:39
合計ジャッジ時間 2,617 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
N, M = map(int, input().split())
C = list(map(int, input().split()))
C.sort()
S = [0]
for c in C:
    S.append(S[-1]+c)
p = bisect.bisect_right(S, M)
print(p-1)
0