結果

問題 No.2424 Josouzai
ユーザー tassei903
提出日時 2023-08-15 02:34:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 173 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 109,056 KB
最終ジャッジ日時 2024-11-26 21:10:00
合計ジャッジ時間 4,415 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
#print(a, k)
i = 0
s = 0
while i < n and s + a[i] <= k:
    s += a[i]
    i += 1
print(i, k - s)
0