結果

問題 No.2424 Josouzai
ユーザー chineristACchineristAC
提出日時 2023-08-18 21:39:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 82,120 KB
実行使用メモリ 107,008 KB
最終ジャッジ日時 2024-05-06 03:34:54
合計ジャッジ時間 4,895 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,096 KB
testcase_01 AC 36 ms
52,628 KB
testcase_02 AC 36 ms
52,352 KB
testcase_03 AC 36 ms
51,968 KB
testcase_04 AC 91 ms
74,752 KB
testcase_05 AC 126 ms
102,016 KB
testcase_06 AC 125 ms
101,304 KB
testcase_07 AC 124 ms
101,308 KB
testcase_08 AC 127 ms
101,888 KB
testcase_09 AC 37 ms
52,608 KB
testcase_10 AC 52 ms
72,944 KB
testcase_11 AC 75 ms
99,456 KB
testcase_12 AC 68 ms
89,728 KB
testcase_13 AC 63 ms
74,624 KB
testcase_14 AC 80 ms
87,168 KB
testcase_15 AC 44 ms
62,464 KB
testcase_16 AC 112 ms
104,960 KB
testcase_17 AC 55 ms
70,272 KB
testcase_18 AC 59 ms
72,576 KB
testcase_19 AC 74 ms
83,456 KB
testcase_20 AC 111 ms
105,664 KB
testcase_21 AC 92 ms
93,824 KB
testcase_22 AC 61 ms
74,240 KB
testcase_23 AC 69 ms
78,720 KB
testcase_24 AC 51 ms
66,944 KB
testcase_25 AC 113 ms
107,008 KB
testcase_26 AC 90 ms
94,592 KB
testcase_27 AC 123 ms
101,376 KB
testcase_28 AC 101 ms
100,224 KB
testcase_29 AC 97 ms
98,048 KB
testcase_30 AC 52 ms
67,456 KB
testcase_31 AC 70 ms
81,280 KB
testcase_32 AC 125 ms
101,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import permutations
import heapq

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N,K = mi()
A = li()
A.sort()

cnt = 0
for a in A:
    if K >= a:
        K -= a
        cnt += 1

print(cnt,K)
0