結果

問題 No.2424 Josouzai
ユーザー machoniumpmachoniump
提出日時 2023-09-12 22:41:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 29,964 KB
最終ジャッジ日時 2023-09-12 22:41:17
合計ジャッジ時間 4,278 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,904 KB
testcase_01 AC 15 ms
7,900 KB
testcase_02 AC 17 ms
7,736 KB
testcase_03 AC 16 ms
7,736 KB
testcase_04 AC 50 ms
14,764 KB
testcase_05 AC 126 ms
29,836 KB
testcase_06 AC 139 ms
29,836 KB
testcase_07 AC 132 ms
29,956 KB
testcase_08 AC 126 ms
29,964 KB
testcase_09 AC 15 ms
7,832 KB
testcase_10 AC 34 ms
14,684 KB
testcase_11 AC 71 ms
27,516 KB
testcase_12 AC 57 ms
22,540 KB
testcase_13 AC 46 ms
14,816 KB
testcase_14 AC 73 ms
20,016 KB
testcase_15 AC 23 ms
9,700 KB
testcase_16 AC 111 ms
26,928 KB
testcase_17 AC 41 ms
13,220 KB
testcase_18 AC 43 ms
13,764 KB
testcase_19 AC 64 ms
17,980 KB
testcase_20 AC 113 ms
27,412 KB
testcase_21 AC 88 ms
22,672 KB
testcase_22 AC 45 ms
14,448 KB
testcase_23 AC 53 ms
15,932 KB
testcase_24 AC 31 ms
11,608 KB
testcase_25 AC 116 ms
28,296 KB
testcase_26 AC 87 ms
22,648 KB
testcase_27 AC 122 ms
29,116 KB
testcase_28 AC 104 ms
26,104 KB
testcase_29 AC 96 ms
23,996 KB
testcase_30 AC 32 ms
11,924 KB
testcase_31 AC 63 ms
17,372 KB
testcase_32 AC 120 ms
28,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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