結果

問題 No.2424 Josouzai
ユーザー rlangevinrlangevin
提出日時 2023-09-18 14:33:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 1,307 ms
コンパイル使用メモリ 86,616 KB
実行使用メモリ 105,028 KB
最終ジャッジ日時 2023-09-18 14:34:14
合計ジャッジ時間 7,072 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,056 KB
testcase_01 AC 74 ms
71,300 KB
testcase_02 AC 73 ms
71,296 KB
testcase_03 AC 73 ms
71,276 KB
testcase_04 AC 101 ms
85,220 KB
testcase_05 AC 162 ms
102,612 KB
testcase_06 AC 158 ms
102,612 KB
testcase_07 AC 161 ms
102,996 KB
testcase_08 AC 161 ms
102,772 KB
testcase_09 AC 74 ms
71,204 KB
testcase_10 AC 88 ms
84,128 KB
testcase_11 AC 137 ms
105,028 KB
testcase_12 AC 103 ms
97,808 KB
testcase_13 AC 99 ms
84,636 KB
testcase_14 AC 115 ms
93,940 KB
testcase_15 AC 80 ms
76,220 KB
testcase_16 AC 152 ms
99,476 KB
testcase_17 AC 94 ms
81,232 KB
testcase_18 AC 96 ms
83,112 KB
testcase_19 AC 112 ms
91,568 KB
testcase_20 AC 148 ms
99,600 KB
testcase_21 AC 128 ms
99,536 KB
testcase_22 AC 97 ms
84,596 KB
testcase_23 AC 102 ms
87,436 KB
testcase_24 AC 87 ms
79,244 KB
testcase_25 AC 171 ms
101,788 KB
testcase_26 AC 125 ms
99,552 KB
testcase_27 AC 161 ms
101,884 KB
testcase_28 AC 138 ms
102,856 KB
testcase_29 AC 132 ms
102,668 KB
testcase_30 AC 88 ms
79,496 KB
testcase_31 AC 109 ms
89,516 KB
testcase_32 AC 158 ms
102,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
ans = 0
while A:
    if K >= A[-1]:
        a = A.pop()
        ans += 1
        K -= a
    else:
        break
    
print(ans, K)
0