結果

問題 No.2424 Josouzai
ユーザー GrayCoderGrayCoder
提出日時 2023-08-18 21:50:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 29,952 KB
最終ジャッジ日時 2023-08-18 21:50:08
合計ジャッジ時間 4,016 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,816 KB
testcase_01 AC 18 ms
7,932 KB
testcase_02 AC 15 ms
7,876 KB
testcase_03 AC 16 ms
7,820 KB
testcase_04 AC 46 ms
14,716 KB
testcase_05 AC 120 ms
29,904 KB
testcase_06 AC 131 ms
29,952 KB
testcase_07 AC 123 ms
29,856 KB
testcase_08 AC 120 ms
29,948 KB
testcase_09 AC 16 ms
7,820 KB
testcase_10 AC 34 ms
14,764 KB
testcase_11 AC 70 ms
27,700 KB
testcase_12 AC 56 ms
22,608 KB
testcase_13 AC 44 ms
14,696 KB
testcase_14 AC 70 ms
19,852 KB
testcase_15 AC 22 ms
9,820 KB
testcase_16 AC 108 ms
27,008 KB
testcase_17 AC 39 ms
12,848 KB
testcase_18 AC 41 ms
13,860 KB
testcase_19 AC 63 ms
18,112 KB
testcase_20 AC 135 ms
27,788 KB
testcase_21 AC 84 ms
22,812 KB
testcase_22 AC 43 ms
14,464 KB
testcase_23 AC 52 ms
15,872 KB
testcase_24 AC 30 ms
11,540 KB
testcase_25 AC 110 ms
28,600 KB
testcase_26 AC 83 ms
22,620 KB
testcase_27 AC 118 ms
29,248 KB
testcase_28 AC 97 ms
26,420 KB
testcase_29 AC 90 ms
24,308 KB
testcase_30 AC 31 ms
12,016 KB
testcase_31 AC 59 ms
17,412 KB
testcase_32 AC 110 ms
29,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def main():
    sys.setrecursionlimit(100000)
    input = lambda: sys.stdin.readline()[:-1]
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    A.sort()
    ans = 0
    for ai in A:
        if K >= ai:
            ans += 1
            K -= ai
        else:
            break
    print(ans, K)


if not __debug__:
    f = open(sys.argv[1], "r")
    sys.stdin = f

try:
    sys.set_int_max_str_digits(100000)
except AttributeError:
    pass

main()
0