結果

問題 No.2424 Josouzai
ユーザー 👑 もぐら 3.0もぐら 3.0
提出日時 2023-11-12 23:29:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 206 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 107,236 KB
最終ジャッジ日時 2023-11-12 23:29:28
合計ジャッジ時間 7,262 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 33 ms
53,460 KB
testcase_02 AC 33 ms
53,460 KB
testcase_03 WA -
testcase_04 AC 59 ms
74,504 KB
testcase_05 AC 125 ms
101,600 KB
testcase_06 AC 117 ms
106,956 KB
testcase_07 AC 118 ms
106,956 KB
testcase_08 AC 125 ms
101,600 KB
testcase_09 AC 34 ms
53,460 KB
testcase_10 AC 46 ms
71,588 KB
testcase_11 AC 72 ms
99,644 KB
testcase_12 AC 67 ms
88,832 KB
testcase_13 AC 58 ms
74,172 KB
testcase_14 AC 77 ms
87,292 KB
testcase_15 AC 40 ms
62,052 KB
testcase_16 AC 104 ms
102,456 KB
testcase_17 AC 51 ms
68,968 KB
testcase_18 AC 56 ms
72,900 KB
testcase_19 AC 71 ms
82,812 KB
testcase_20 AC 105 ms
102,772 KB
testcase_21 AC 88 ms
94,588 KB
testcase_22 AC 59 ms
74,112 KB
testcase_23 AC 64 ms
77,088 KB
testcase_24 AC 47 ms
66,976 KB
testcase_25 AC 114 ms
107,008 KB
testcase_26 AC 88 ms
94,584 KB
testcase_27 AC 117 ms
107,236 KB
testcase_28 AC 100 ms
98,552 KB
testcase_29 AC 95 ms
97,612 KB
testcase_30 AC 48 ms
67,308 KB
testcase_31 AC 69 ms
81,068 KB
testcase_32 AC 116 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
    else:
        print(ans,remain)
        exit()
0