結果

問題 No.2424 Josouzai
ユーザー CecilCecil
提出日時 2023-08-18 21:04:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 212 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 32,516 KB
最終ジャッジ日時 2024-05-06 02:31:50
合計ジャッジ時間 3,884 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,624 KB
testcase_01 AC 24 ms
10,624 KB
testcase_02 AC 25 ms
10,496 KB
testcase_03 RE -
testcase_04 AC 57 ms
17,228 KB
testcase_05 AC 135 ms
32,512 KB
testcase_06 AC 135 ms
32,236 KB
testcase_07 AC 134 ms
32,236 KB
testcase_08 AC 136 ms
32,516 KB
testcase_09 AC 27 ms
10,496 KB
testcase_10 AC 45 ms
16,252 KB
testcase_11 AC 81 ms
27,512 KB
testcase_12 AC 67 ms
23,072 KB
testcase_13 AC 54 ms
17,320 KB
testcase_14 AC 83 ms
22,448 KB
testcase_15 AC 33 ms
12,288 KB
testcase_16 AC 119 ms
29,672 KB
testcase_17 AC 48 ms
15,464 KB
testcase_18 AC 51 ms
16,436 KB
testcase_19 AC 72 ms
20,700 KB
testcase_20 AC 120 ms
30,260 KB
testcase_21 AC 93 ms
25,540 KB
testcase_22 AC 56 ms
17,192 KB
testcase_23 AC 61 ms
18,580 KB
testcase_24 AC 40 ms
14,032 KB
testcase_25 AC 122 ms
31,492 KB
testcase_26 AC 95 ms
25,468 KB
testcase_27 AC 130 ms
31,844 KB
testcase_28 AC 115 ms
28,908 KB
testcase_29 AC 106 ms
27,024 KB
testcase_30 AC 44 ms
14,344 KB
testcase_31 AC 71 ms
20,156 KB
testcase_32 AC 129 ms
31,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
i = 0
ans = 0
while True:
    if k - a[i] >= 0:
        k -= a[i]
        i += 1
        ans += 1
    else:
        break
print(ans, k)
0