結果

問題 No.2424 Josouzai
ユーザー kfieldkfield
提出日時 2023-08-19 09:04:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 107,520 KB
最終ジャッジ日時 2024-05-06 16:16:22
合計ジャッジ時間 5,298 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,840 KB
testcase_01 AC 40 ms
51,584 KB
testcase_02 AC 41 ms
51,712 KB
testcase_03 AC 44 ms
51,840 KB
testcase_04 AC 73 ms
73,984 KB
testcase_05 AC 140 ms
101,888 KB
testcase_06 AC 132 ms
107,132 KB
testcase_07 AC 132 ms
107,392 KB
testcase_08 AC 140 ms
102,144 KB
testcase_09 AC 40 ms
51,712 KB
testcase_10 AC 58 ms
71,808 KB
testcase_11 AC 85 ms
98,048 KB
testcase_12 AC 74 ms
88,960 KB
testcase_13 AC 68 ms
73,088 KB
testcase_14 AC 90 ms
85,760 KB
testcase_15 AC 50 ms
61,696 KB
testcase_16 AC 120 ms
102,784 KB
testcase_17 AC 60 ms
68,992 KB
testcase_18 AC 65 ms
71,296 KB
testcase_19 AC 82 ms
82,304 KB
testcase_20 AC 118 ms
103,040 KB
testcase_21 AC 100 ms
92,800 KB
testcase_22 AC 70 ms
73,088 KB
testcase_23 AC 73 ms
76,672 KB
testcase_24 AC 56 ms
66,048 KB
testcase_25 AC 125 ms
107,520 KB
testcase_26 AC 100 ms
93,056 KB
testcase_27 AC 126 ms
107,520 KB
testcase_28 AC 108 ms
98,816 KB
testcase_29 AC 105 ms
96,896 KB
testcase_30 AC 55 ms
66,432 KB
testcase_31 AC 75 ms
80,000 KB
testcase_32 AC 124 ms
107,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
cnt=0
for i in range(n):
    if k>=a[i]:
        cnt+=1
        k-=a[i]
    else:
        break
print(cnt, k)
0