結果

問題 No.2424 Josouzai
ユーザー 👑 もぐら 3.0もぐら 3.0
提出日時 2023-11-12 23:30:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 182 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 108,288 KB
最終ジャッジ日時 2023-11-12 23:30:32
合計ジャッジ時間 4,105 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,460 KB
testcase_01 AC 33 ms
53,460 KB
testcase_02 AC 34 ms
53,460 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 61 ms
74,504 KB
testcase_05 AC 127 ms
101,644 KB
testcase_06 AC 120 ms
106,956 KB
testcase_07 AC 123 ms
106,956 KB
testcase_08 AC 129 ms
101,644 KB
testcase_09 AC 35 ms
53,460 KB
testcase_10 AC 49 ms
71,972 KB
testcase_11 AC 74 ms
100,028 KB
testcase_12 AC 65 ms
89,344 KB
testcase_13 AC 60 ms
74,684 KB
testcase_14 AC 79 ms
87,804 KB
testcase_15 AC 42 ms
62,564 KB
testcase_16 AC 107 ms
103,352 KB
testcase_17 AC 54 ms
71,564 KB
testcase_18 AC 57 ms
73,412 KB
testcase_19 AC 74 ms
83,324 KB
testcase_20 AC 111 ms
103,668 KB
testcase_21 AC 91 ms
95,100 KB
testcase_22 AC 59 ms
74,624 KB
testcase_23 AC 66 ms
77,600 KB
testcase_24 AC 49 ms
67,488 KB
testcase_25 AC 118 ms
108,288 KB
testcase_26 AC 90 ms
95,096 KB
testcase_27 AC 118 ms
107,236 KB
testcase_28 AC 103 ms
99,448 KB
testcase_29 AC 97 ms
98,252 KB
testcase_30 AC 50 ms
67,820 KB
testcase_31 AC 72 ms
81,580 KB
testcase_32 AC 119 ms
107,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans=0
remain = K
for n in A:
    if remain>=n:
        remain-=n
        ans+=1
        
print(ans,remain)
0