結果

問題 No.2424 Josouzai
ユーザー loop0919loop0919
提出日時 2023-08-18 21:07:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 484 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 108,928 KB
最終ジャッジ日時 2024-05-06 02:38:22
合計ジャッジ時間 4,835 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,328 KB
testcase_01 AC 36 ms
51,456 KB
testcase_02 AC 35 ms
51,584 KB
testcase_03 AC 34 ms
51,584 KB
testcase_04 AC 63 ms
74,240 KB
testcase_05 AC 124 ms
101,888 KB
testcase_06 AC 119 ms
108,928 KB
testcase_07 AC 120 ms
108,800 KB
testcase_08 AC 124 ms
101,888 KB
testcase_09 AC 35 ms
51,712 KB
testcase_10 AC 51 ms
71,808 KB
testcase_11 AC 75 ms
99,072 KB
testcase_12 AC 66 ms
89,728 KB
testcase_13 AC 61 ms
73,344 KB
testcase_14 AC 80 ms
86,400 KB
testcase_15 AC 44 ms
61,440 KB
testcase_16 AC 107 ms
103,808 KB
testcase_17 AC 56 ms
69,376 KB
testcase_18 AC 58 ms
71,936 KB
testcase_19 AC 76 ms
82,816 KB
testcase_20 AC 107 ms
104,320 KB
testcase_21 AC 93 ms
93,824 KB
testcase_22 AC 60 ms
73,600 KB
testcase_23 AC 65 ms
77,312 KB
testcase_24 AC 50 ms
66,176 KB
testcase_25 AC 111 ms
108,672 KB
testcase_26 AC 90 ms
94,336 KB
testcase_27 AC 115 ms
108,800 KB
testcase_28 AC 101 ms
100,096 KB
testcase_29 AC 96 ms
97,920 KB
testcase_30 AC 54 ms
66,560 KB
testcase_31 AC 71 ms
80,256 KB
testcase_32 AC 115 ms
108,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

a_list = sorted(list(map(int, input().split())))

cnt = 0
for a in a_list:
    if K >= a:
        cnt += 1
        K -= a
    else:
        break

print(cnt, K)
0