結果

問題 No.2424 Josouzai
ユーザー gr1msl3ygr1msl3y
提出日時 2023-08-21 10:28:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 131 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 108,416 KB
最終ジャッジ日時 2024-05-08 15:47:48
合計ジャッジ時間 5,302 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,096 KB
testcase_01 AC 43 ms
51,968 KB
testcase_02 AC 41 ms
51,968 KB
testcase_03 AC 42 ms
52,352 KB
testcase_04 AC 75 ms
74,624 KB
testcase_05 AC 146 ms
101,888 KB
testcase_06 AC 138 ms
107,264 KB
testcase_07 AC 138 ms
107,008 KB
testcase_08 AC 144 ms
102,144 KB
testcase_09 AC 41 ms
51,584 KB
testcase_10 AC 62 ms
72,320 KB
testcase_11 AC 91 ms
99,072 KB
testcase_12 AC 78 ms
89,344 KB
testcase_13 AC 76 ms
73,984 KB
testcase_14 AC 93 ms
86,272 KB
testcase_15 AC 54 ms
62,720 KB
testcase_16 AC 124 ms
103,552 KB
testcase_17 AC 66 ms
69,632 KB
testcase_18 AC 69 ms
72,320 KB
testcase_19 AC 90 ms
83,072 KB
testcase_20 AC 126 ms
103,936 KB
testcase_21 AC 111 ms
93,824 KB
testcase_22 AC 72 ms
73,728 KB
testcase_23 AC 77 ms
77,952 KB
testcase_24 AC 59 ms
66,816 KB
testcase_25 AC 133 ms
108,416 KB
testcase_26 AC 104 ms
93,696 KB
testcase_27 AC 137 ms
107,520 KB
testcase_28 AC 119 ms
99,328 KB
testcase_29 AC 113 ms
97,408 KB
testcase_30 AC 61 ms
66,944 KB
testcase_31 AC 85 ms
80,384 KB
testcase_32 AC 137 ms
107,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
c,s=0,0
for a in A:
	if s+a<=K:
		s+=a
		c+=1

print(c,K-s)
0