結果

問題 No.2424 Josouzai
ユーザー Akijin_007Akijin_007
提出日時 2023-08-18 21:16:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 184 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 108,928 KB
最終ジャッジ日時 2024-05-06 02:57:43
合計ジャッジ時間 4,066 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,584 KB
testcase_01 AC 35 ms
52,096 KB
testcase_02 AC 40 ms
51,584 KB
testcase_03 AC 36 ms
51,456 KB
testcase_04 AC 61 ms
74,040 KB
testcase_05 AC 125 ms
101,768 KB
testcase_06 AC 114 ms
108,864 KB
testcase_07 AC 117 ms
108,672 KB
testcase_08 AC 124 ms
101,760 KB
testcase_09 AC 35 ms
51,584 KB
testcase_10 AC 51 ms
72,192 KB
testcase_11 AC 74 ms
99,456 KB
testcase_12 AC 64 ms
89,856 KB
testcase_13 AC 62 ms
73,856 KB
testcase_14 AC 79 ms
86,528 KB
testcase_15 AC 42 ms
61,696 KB
testcase_16 AC 104 ms
103,808 KB
testcase_17 AC 52 ms
68,864 KB
testcase_18 AC 55 ms
72,192 KB
testcase_19 AC 71 ms
82,816 KB
testcase_20 AC 106 ms
104,320 KB
testcase_21 AC 88 ms
94,080 KB
testcase_22 AC 57 ms
73,344 KB
testcase_23 AC 63 ms
77,184 KB
testcase_24 AC 48 ms
65,792 KB
testcase_25 AC 112 ms
108,288 KB
testcase_26 AC 90 ms
94,208 KB
testcase_27 AC 116 ms
108,928 KB
testcase_28 AC 100 ms
99,980 KB
testcase_29 AC 95 ms
97,664 KB
testcase_30 AC 50 ms
66,560 KB
testcase_31 AC 70 ms
80,512 KB
testcase_32 AC 115 ms
108,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))

A = sorted(A)

ans = 0
for i in range(N):
    if K < A[i]:
        break
    ans += 1
    K -= A[i]

print(ans, K)
0