結果

問題 No.2424 Josouzai
ユーザー 👑 H20H20
提出日時 2023-08-18 21:01:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 152 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 82,008 KB
実行使用メモリ 108,536 KB
最終ジャッジ日時 2024-05-06 02:24:23
合計ジャッジ時間 4,181 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,712 KB
testcase_01 AC 34 ms
51,968 KB
testcase_02 AC 33 ms
51,584 KB
testcase_03 AC 36 ms
51,584 KB
testcase_04 AC 70 ms
74,240 KB
testcase_05 AC 131 ms
102,016 KB
testcase_06 AC 116 ms
107,316 KB
testcase_07 AC 122 ms
107,264 KB
testcase_08 AC 123 ms
101,888 KB
testcase_09 AC 34 ms
51,840 KB
testcase_10 AC 50 ms
72,448 KB
testcase_11 AC 73 ms
98,816 KB
testcase_12 AC 67 ms
89,344 KB
testcase_13 AC 59 ms
73,984 KB
testcase_14 AC 78 ms
86,400 KB
testcase_15 AC 43 ms
62,464 KB
testcase_16 AC 109 ms
103,456 KB
testcase_17 AC 56 ms
69,648 KB
testcase_18 AC 59 ms
72,192 KB
testcase_19 AC 71 ms
83,272 KB
testcase_20 AC 105 ms
103,780 KB
testcase_21 AC 91 ms
93,696 KB
testcase_22 AC 59 ms
73,728 KB
testcase_23 AC 65 ms
77,952 KB
testcase_24 AC 50 ms
67,072 KB
testcase_25 AC 113 ms
108,536 KB
testcase_26 AC 91 ms
93,824 KB
testcase_27 AC 118 ms
107,316 KB
testcase_28 AC 99 ms
99,584 KB
testcase_29 AC 94 ms
98,048 KB
testcase_30 AC 49 ms
67,200 KB
testcase_31 AC 69 ms
80,640 KB
testcase_32 AC 114 ms
107,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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