結果

問題 No.2424 Josouzai
ユーザー taro2023taro2023
提出日時 2023-08-18 22:43:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 33,132 KB
最終ジャッジ日時 2024-11-28 08:52:07
合計ジャッジ時間 4,488 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b= map(int, input().split())
c = list(map(int, input().split()))
c=sorted(c)
e=0
if c[0]>b:
    print(0,b-c[0])
    exit()
for i in range(len(c)):
    e+=c[i]
    if e>b:
        e-=c[i]
        break
if i==0:
    print(i+1,b-e)
else:
    print(i,b-e)
0