結果

問題 No.2424 Josouzai
ユーザー ikomaikoma
提出日時 2023-08-18 23:35:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 144 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 108,416 KB
最終ジャッジ日時 2024-05-06 06:22:50
合計ジャッジ時間 4,798 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,840 KB
testcase_01 AC 42 ms
51,712 KB
testcase_02 AC 40 ms
51,712 KB
testcase_03 AC 41 ms
51,712 KB
testcase_04 AC 74 ms
74,112 KB
testcase_05 AC 144 ms
101,760 KB
testcase_06 AC 135 ms
107,136 KB
testcase_07 AC 138 ms
107,264 KB
testcase_08 AC 145 ms
101,632 KB
testcase_09 AC 42 ms
51,584 KB
testcase_10 AC 61 ms
72,064 KB
testcase_11 AC 88 ms
98,432 KB
testcase_12 AC 78 ms
89,216 KB
testcase_13 AC 72 ms
74,112 KB
testcase_14 AC 94 ms
86,144 KB
testcase_15 AC 53 ms
62,208 KB
testcase_16 AC 125 ms
103,168 KB
testcase_17 AC 65 ms
69,632 KB
testcase_18 AC 69 ms
72,192 KB
testcase_19 AC 85 ms
82,688 KB
testcase_20 AC 123 ms
103,552 KB
testcase_21 AC 103 ms
93,440 KB
testcase_22 AC 71 ms
73,728 KB
testcase_23 AC 79 ms
77,568 KB
testcase_24 AC 61 ms
66,560 KB
testcase_25 AC 134 ms
108,416 KB
testcase_26 AC 103 ms
93,440 KB
testcase_27 AC 135 ms
107,392 KB
testcase_28 AC 118 ms
99,200 KB
testcase_29 AC 111 ms
97,664 KB
testcase_30 AC 60 ms
67,200 KB
testcase_31 AC 82 ms
80,640 KB
testcase_32 AC 134 ms
107,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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