結果

問題 No.2424 Josouzai
ユーザー pyt-314pyt-314
提出日時 2024-03-11 20:55:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 192 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 31,872 KB
最終ジャッジ日時 2024-03-11 20:55:20
合計ジャッジ時間 7,675 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,856 KB
testcase_01 AC 29 ms
9,856 KB
testcase_02 AC 28 ms
9,856 KB
testcase_03 AC 28 ms
9,856 KB
testcase_04 AC 62 ms
16,524 KB
testcase_05 AC 147 ms
31,872 KB
testcase_06 AC 148 ms
31,864 KB
testcase_07 AC 146 ms
31,864 KB
testcase_08 AC 159 ms
31,872 KB
testcase_09 AC 28 ms
9,856 KB
testcase_10 AC 47 ms
16,520 KB
testcase_11 AC 84 ms
29,516 KB
testcase_12 AC 70 ms
24,476 KB
testcase_13 AC 61 ms
16,520 KB
testcase_14 AC 90 ms
21,784 KB
testcase_15 AC 38 ms
11,624 KB
testcase_16 AC 134 ms
29,016 KB
testcase_17 AC 51 ms
14,788 KB
testcase_18 AC 60 ms
15,760 KB
testcase_19 AC 80 ms
20,032 KB
testcase_20 AC 140 ms
30,056 KB
testcase_21 AC 106 ms
24,656 KB
testcase_22 AC 59 ms
16,264 KB
testcase_23 AC 68 ms
17,896 KB
testcase_24 AC 46 ms
13,484 KB
testcase_25 AC 140 ms
31,020 KB
testcase_26 AC 106 ms
24,676 KB
testcase_27 AC 145 ms
31,188 KB
testcase_28 AC 128 ms
29,108 KB
testcase_29 AC 123 ms
26,112 KB
testcase_30 AC 48 ms
13,800 KB
testcase_31 AC 78 ms
19,360 KB
testcase_32 AC 148 ms
31,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
c = 0
for i in a:
    k -= i
    if k < 0:
        k += i
        break
    else:
        c += 1
print(c, k)
0