結果

問題 No.2424 Josouzai
ユーザー pluto77pluto77
提出日時 2023-08-22 10:56:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 135 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 10,436 KB
実行使用メモリ 29,936 KB
最終ジャッジ日時 2023-08-22 10:56:17
合計ジャッジ時間 5,530 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,880 KB
testcase_01 AC 16 ms
7,700 KB
testcase_02 AC 15 ms
7,744 KB
testcase_03 AC 16 ms
7,788 KB
testcase_04 AC 61 ms
14,836 KB
testcase_05 AC 167 ms
29,936 KB
testcase_06 AC 190 ms
29,892 KB
testcase_07 AC 165 ms
29,848 KB
testcase_08 AC 170 ms
29,760 KB
testcase_09 AC 15 ms
7,788 KB
testcase_10 AC 41 ms
14,628 KB
testcase_11 AC 94 ms
27,596 KB
testcase_12 AC 74 ms
22,516 KB
testcase_13 AC 55 ms
14,632 KB
testcase_14 AC 89 ms
19,852 KB
testcase_15 AC 25 ms
9,660 KB
testcase_16 AC 143 ms
27,052 KB
testcase_17 AC 44 ms
12,748 KB
testcase_18 AC 50 ms
13,632 KB
testcase_19 AC 77 ms
18,000 KB
testcase_20 AC 153 ms
28,216 KB
testcase_21 AC 109 ms
22,660 KB
testcase_22 AC 54 ms
14,252 KB
testcase_23 AC 65 ms
15,780 KB
testcase_24 AC 35 ms
11,512 KB
testcase_25 AC 158 ms
29,320 KB
testcase_26 AC 110 ms
22,632 KB
testcase_27 AC 189 ms
29,168 KB
testcase_28 AC 137 ms
27,296 KB
testcase_29 AC 123 ms
23,984 KB
testcase_30 AC 38 ms
11,848 KB
testcase_31 AC 74 ms
17,236 KB
testcase_32 AC 159 ms
29,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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