結果

問題 No.2424 Josouzai
ユーザー ryohei22ryohei22
提出日時 2023-08-18 21:03:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 108,928 KB
最終ジャッジ日時 2024-05-06 02:30:32
合計ジャッジ時間 4,078 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,712 KB
testcase_01 AC 38 ms
51,584 KB
testcase_02 AC 38 ms
51,584 KB
testcase_03 AC 36 ms
51,968 KB
testcase_04 AC 63 ms
74,112 KB
testcase_05 AC 126 ms
102,016 KB
testcase_06 AC 118 ms
108,928 KB
testcase_07 AC 124 ms
108,672 KB
testcase_08 AC 134 ms
101,760 KB
testcase_09 AC 38 ms
51,584 KB
testcase_10 AC 57 ms
71,680 KB
testcase_11 AC 83 ms
99,456 KB
testcase_12 AC 70 ms
89,600 KB
testcase_13 AC 66 ms
73,600 KB
testcase_14 AC 82 ms
86,016 KB
testcase_15 AC 44 ms
61,440 KB
testcase_16 AC 108 ms
103,936 KB
testcase_17 AC 56 ms
69,504 KB
testcase_18 AC 59 ms
71,936 KB
testcase_19 AC 74 ms
82,816 KB
testcase_20 AC 111 ms
104,320 KB
testcase_21 AC 92 ms
93,696 KB
testcase_22 AC 65 ms
73,216 KB
testcase_23 AC 69 ms
77,440 KB
testcase_24 AC 52 ms
65,920 KB
testcase_25 AC 117 ms
108,416 KB
testcase_26 AC 94 ms
94,080 KB
testcase_27 AC 122 ms
108,928 KB
testcase_28 AC 110 ms
99,712 KB
testcase_29 AC 104 ms
98,176 KB
testcase_30 AC 52 ms
66,560 KB
testcase_31 AC 74 ms
80,384 KB
testcase_32 AC 123 ms
108,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

cnt = 0
for i in A:
    if i <= K:
        K -= i
        cnt += 1
    else:
        break
print(cnt, K)
0