結果

問題 No.2424 Josouzai
ユーザー QroQro
提出日時 2023-08-18 21:06:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 167 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 108,800 KB
最終ジャッジ日時 2024-05-06 02:36:30
合計ジャッジ時間 4,085 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,712 KB
testcase_01 AC 43 ms
51,328 KB
testcase_02 AC 43 ms
51,712 KB
testcase_03 AC 42 ms
51,968 KB
testcase_04 AC 77 ms
74,496 KB
testcase_05 AC 134 ms
101,888 KB
testcase_06 AC 126 ms
107,136 KB
testcase_07 AC 123 ms
107,136 KB
testcase_08 AC 131 ms
101,632 KB
testcase_09 AC 36 ms
51,840 KB
testcase_10 AC 55 ms
72,064 KB
testcase_11 AC 82 ms
98,560 KB
testcase_12 AC 71 ms
89,600 KB
testcase_13 AC 64 ms
74,240 KB
testcase_14 AC 82 ms
86,144 KB
testcase_15 AC 44 ms
62,336 KB
testcase_16 AC 110 ms
103,296 KB
testcase_17 AC 57 ms
70,016 KB
testcase_18 AC 60 ms
72,192 KB
testcase_19 AC 77 ms
83,328 KB
testcase_20 AC 114 ms
104,064 KB
testcase_21 AC 96 ms
93,568 KB
testcase_22 AC 64 ms
73,856 KB
testcase_23 AC 69 ms
77,312 KB
testcase_24 AC 51 ms
66,688 KB
testcase_25 AC 119 ms
108,800 KB
testcase_26 AC 93 ms
93,568 KB
testcase_27 AC 121 ms
107,520 KB
testcase_28 AC 107 ms
99,712 KB
testcase_29 AC 100 ms
97,920 KB
testcase_30 AC 55 ms
66,944 KB
testcase_31 AC 77 ms
80,640 KB
testcase_32 AC 121 ms
107,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
count=0
for i in range(N):
    if K-A[i] >= 0:
        K-=A[i]
        count+=1

print(count,K)
0