結果

問題 No.2424 Josouzai
ユーザー lloyzlloyz
提出日時 2023-08-18 21:31:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,480 KB
実行使用メモリ 29,852 KB
最終ジャッジ日時 2023-08-18 21:31:15
合計ジャッジ時間 4,124 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,880 KB
testcase_01 AC 21 ms
7,780 KB
testcase_02 AC 15 ms
7,792 KB
testcase_03 AC 16 ms
7,852 KB
testcase_04 AC 48 ms
14,656 KB
testcase_05 AC 126 ms
29,836 KB
testcase_06 AC 125 ms
29,852 KB
testcase_07 AC 127 ms
29,844 KB
testcase_08 AC 128 ms
29,732 KB
testcase_09 AC 15 ms
7,856 KB
testcase_10 AC 34 ms
14,728 KB
testcase_11 AC 72 ms
27,668 KB
testcase_12 AC 57 ms
22,376 KB
testcase_13 AC 46 ms
14,732 KB
testcase_14 AC 71 ms
19,992 KB
testcase_15 AC 23 ms
9,704 KB
testcase_16 AC 110 ms
26,900 KB
testcase_17 AC 38 ms
12,824 KB
testcase_18 AC 42 ms
13,628 KB
testcase_19 AC 64 ms
18,016 KB
testcase_20 AC 113 ms
27,244 KB
testcase_21 AC 87 ms
22,552 KB
testcase_22 AC 46 ms
14,396 KB
testcase_23 AC 52 ms
15,916 KB
testcase_24 AC 30 ms
11,428 KB
testcase_25 AC 116 ms
28,416 KB
testcase_26 AC 86 ms
22,640 KB
testcase_27 AC 121 ms
29,148 KB
testcase_28 AC 103 ms
26,076 KB
testcase_29 AC 93 ms
24,056 KB
testcase_30 AC 32 ms
11,880 KB
testcase_31 AC 60 ms
17,376 KB
testcase_32 AC 118 ms
28,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))

A.sort()
ANS = [0, k]
for i in range(n):
    if ANS[1] >= A[i]:
        ANS[0] += 1
        ANS[1] -= A[i]
    else:
        break
print(*ANS)
0