結果

問題 No.2424 Josouzai
ユーザー YU HiroseYU Hirose
提出日時 2024-04-25 14:21:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 226 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,644 KB
最終ジャッジ日時 2024-04-25 14:21:59
合計ジャッジ時間 5,857 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,752 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 WA -
testcase_04 AC 88 ms
17,228 KB
testcase_05 AC 216 ms
32,640 KB
testcase_06 AC 222 ms
32,360 KB
testcase_07 AC 216 ms
32,364 KB
testcase_08 AC 216 ms
32,644 KB
testcase_09 AC 29 ms
10,624 KB
testcase_10 AC 63 ms
16,440 KB
testcase_11 AC 134 ms
27,604 KB
testcase_12 AC 109 ms
23,204 KB
testcase_13 AC 79 ms
17,320 KB
testcase_14 AC 121 ms
22,576 KB
testcase_15 AC 40 ms
12,544 KB
testcase_16 AC 188 ms
29,804 KB
testcase_17 AC 65 ms
15,596 KB
testcase_18 AC 73 ms
16,560 KB
testcase_19 AC 108 ms
20,956 KB
testcase_20 AC 190 ms
30,384 KB
testcase_21 AC 150 ms
25,796 KB
testcase_22 AC 80 ms
17,284 KB
testcase_23 AC 89 ms
18,700 KB
testcase_24 AC 55 ms
14,712 KB
testcase_25 AC 207 ms
31,620 KB
testcase_26 AC 149 ms
25,472 KB
testcase_27 AC 210 ms
31,912 KB
testcase_28 AC 178 ms
29,036 KB
testcase_29 AC 169 ms
27,276 KB
testcase_30 AC 56 ms
14,516 KB
testcase_31 AC 102 ms
20,160 KB
testcase_32 AC 208 ms
31,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
acc = list(accumulate(a))
cnt = 0
for i in range(n):
    if acc[i] < k:
        cnt += 1
print(cnt, k - acc[cnt-1])
0