結果

問題 No.2424 Josouzai
ユーザー 👑 tatyamtatyam
提出日時 2023-08-15 23:08:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 154 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 108,572 KB
最終ジャッジ日時 2024-05-05 03:46:44
合計ジャッジ時間 3,795 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,840 KB
testcase_01 AC 33 ms
51,968 KB
testcase_02 AC 34 ms
51,956 KB
testcase_03 AC 33 ms
51,712 KB
testcase_04 AC 60 ms
74,368 KB
testcase_05 AC 121 ms
102,016 KB
testcase_06 AC 112 ms
107,440 KB
testcase_07 AC 113 ms
107,308 KB
testcase_08 AC 117 ms
102,016 KB
testcase_09 AC 33 ms
51,584 KB
testcase_10 AC 47 ms
72,448 KB
testcase_11 AC 71 ms
98,688 KB
testcase_12 AC 62 ms
89,600 KB
testcase_13 AC 57 ms
73,856 KB
testcase_14 AC 76 ms
86,528 KB
testcase_15 AC 43 ms
62,592 KB
testcase_16 AC 100 ms
103,936 KB
testcase_17 AC 54 ms
69,760 KB
testcase_18 AC 59 ms
72,448 KB
testcase_19 AC 70 ms
82,944 KB
testcase_20 AC 101 ms
103,680 KB
testcase_21 AC 84 ms
93,568 KB
testcase_22 AC 55 ms
74,112 KB
testcase_23 AC 61 ms
77,952 KB
testcase_24 AC 46 ms
66,816 KB
testcase_25 AC 108 ms
108,572 KB
testcase_26 AC 87 ms
93,824 KB
testcase_27 AC 111 ms
107,576 KB
testcase_28 AC 99 ms
99,584 KB
testcase_29 AC 93 ms
97,920 KB
testcase_30 AC 53 ms
66,944 KB
testcase_31 AC 72 ms
80,640 KB
testcase_32 AC 109 ms
107,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = sorted(map(int, input().split()))

ans = 0
for a in A:
    if a <= K:
        K -= a
        ans += 1

print(ans, K)
0