結果

問題 No.2424 Josouzai
ユーザー V_MelvilleV_Melville
提出日時 2023-08-18 22:25:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 194 ms / 2,000 ms
コード長 176 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 103,636 KB
最終ジャッジ日時 2023-08-18 22:25:15
合計ジャッジ時間 6,422 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,272 KB
testcase_01 AC 74 ms
71,344 KB
testcase_02 AC 75 ms
71,368 KB
testcase_03 AC 75 ms
71,368 KB
testcase_04 AC 99 ms
84,816 KB
testcase_05 AC 194 ms
101,452 KB
testcase_06 AC 187 ms
101,788 KB
testcase_07 AC 158 ms
101,900 KB
testcase_08 AC 164 ms
101,572 KB
testcase_09 AC 74 ms
71,284 KB
testcase_10 AC 90 ms
83,736 KB
testcase_11 AC 109 ms
103,636 KB
testcase_12 AC 101 ms
97,004 KB
testcase_13 AC 95 ms
84,224 KB
testcase_14 AC 115 ms
93,364 KB
testcase_15 AC 80 ms
76,404 KB
testcase_16 AC 153 ms
99,752 KB
testcase_17 AC 89 ms
81,276 KB
testcase_18 AC 95 ms
83,052 KB
testcase_19 AC 108 ms
90,948 KB
testcase_20 AC 147 ms
99,672 KB
testcase_21 AC 126 ms
98,604 KB
testcase_22 AC 95 ms
84,376 KB
testcase_23 AC 99 ms
87,152 KB
testcase_24 AC 86 ms
79,160 KB
testcase_25 AC 156 ms
102,008 KB
testcase_26 AC 125 ms
98,588 KB
testcase_27 AC 157 ms
100,532 KB
testcase_28 AC 136 ms
101,956 KB
testcase_29 AC 131 ms
101,692 KB
testcase_30 AC 86 ms
79,604 KB
testcase_31 AC 108 ms
89,124 KB
testcase_32 AC 155 ms
101,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
cnt = 0
for i in range(n):
    if k < a[i]:
        break
    cnt += 1
    k -= a[i]
print(cnt, k)
0