結果

問題 No.2424 Josouzai
ユーザー GrayCoderGrayCoder
提出日時 2023-08-18 21:46:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 498 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 29,908 KB
最終ジャッジ日時 2023-08-18 21:47:10
合計ジャッジ時間 4,386 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,756 KB
testcase_01 AC 16 ms
7,848 KB
testcase_02 AC 16 ms
7,912 KB
testcase_03 WA -
testcase_04 AC 47 ms
14,652 KB
testcase_05 AC 129 ms
29,908 KB
testcase_06 AC 123 ms
29,900 KB
testcase_07 AC 122 ms
29,896 KB
testcase_08 AC 123 ms
29,884 KB
testcase_09 AC 15 ms
7,804 KB
testcase_10 AC 34 ms
14,756 KB
testcase_11 AC 70 ms
27,640 KB
testcase_12 AC 56 ms
22,528 KB
testcase_13 AC 46 ms
14,872 KB
testcase_14 AC 72 ms
19,936 KB
testcase_15 AC 22 ms
9,964 KB
testcase_16 AC 107 ms
27,012 KB
testcase_17 AC 39 ms
12,976 KB
testcase_18 AC 41 ms
13,916 KB
testcase_19 AC 61 ms
18,120 KB
testcase_20 AC 111 ms
27,848 KB
testcase_21 AC 86 ms
22,828 KB
testcase_22 AC 44 ms
14,428 KB
testcase_23 AC 52 ms
15,916 KB
testcase_24 AC 30 ms
11,616 KB
testcase_25 AC 112 ms
28,692 KB
testcase_26 AC 87 ms
22,636 KB
testcase_27 AC 119 ms
29,204 KB
testcase_28 AC 101 ms
26,420 KB
testcase_29 AC 118 ms
24,324 KB
testcase_30 AC 32 ms
12,048 KB
testcase_31 AC 60 ms
17,312 KB
testcase_32 AC 116 ms
29,336 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:
            print(ans, K)
            break


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