結果

問題 No.2424 Josouzai
ユーザー ああいい
提出日時 2023-08-18 23:04:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 402 ms
コンパイル使用メモリ 81,232 KB
実行使用メモリ 107,392 KB
最終ジャッジ日時 2024-11-28 09:40:42
合計ジャッジ時間 4,495 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
ans = 0
import sys
now = 0
for i in range(N):
	a = A[i]
	if now + a > K:
		print(i,K - now)
		exit()
	else:
		now += a
print(N,K - now)
0