結果

問題 No.2424 Josouzai
ユーザー minimumminimum
提出日時 2023-08-18 21:24:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 103,368 KB
最終ジャッジ日時 2023-08-18 21:24:16
合計ジャッジ時間 6,029 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,112 KB
testcase_01 AC 77 ms
71,320 KB
testcase_02 AC 76 ms
71,264 KB
testcase_03 AC 75 ms
71,188 KB
testcase_04 AC 106 ms
84,564 KB
testcase_05 AC 166 ms
101,280 KB
testcase_06 AC 162 ms
101,336 KB
testcase_07 AC 165 ms
101,556 KB
testcase_08 AC 164 ms
101,124 KB
testcase_09 AC 77 ms
71,104 KB
testcase_10 AC 90 ms
83,720 KB
testcase_11 AC 115 ms
103,368 KB
testcase_12 AC 106 ms
96,784 KB
testcase_13 AC 100 ms
84,116 KB
testcase_14 AC 135 ms
93,104 KB
testcase_15 AC 84 ms
76,112 KB
testcase_16 AC 155 ms
99,412 KB
testcase_17 AC 93 ms
80,960 KB
testcase_18 AC 97 ms
82,776 KB
testcase_19 AC 113 ms
90,724 KB
testcase_20 AC 154 ms
99,504 KB
testcase_21 AC 132 ms
98,548 KB
testcase_22 AC 99 ms
83,956 KB
testcase_23 AC 106 ms
86,992 KB
testcase_24 AC 88 ms
78,976 KB
testcase_25 AC 163 ms
101,956 KB
testcase_26 AC 131 ms
98,604 KB
testcase_27 AC 164 ms
100,392 KB
testcase_28 AC 145 ms
101,736 KB
testcase_29 AC 137 ms
101,460 KB
testcase_30 AC 90 ms
79,212 KB
testcase_31 AC 111 ms
89,000 KB
testcase_32 AC 164 ms
100,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

s = 0
for i in range(N):
    if s + A[i] > K:
        print(i, K - s)
        exit()
    s += A[i]

print(N, K - s)
0