結果

問題 No.2424 Josouzai
ユーザー もぐら 3.0
提出日時 2023-11-12 23:29:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 206 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 107,648 KB
最終ジャッジ日時 2024-09-26 03:06:26
合計ジャッジ時間 4,844 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 32 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

ans=0
remain = K
for n in A:
    if remain>=n:
        remain-=n
        ans+=1
    else:
        print(ans,remain)
        exit()
0