結果

問題 No.2424 Josouzai
ユーザー minimumminimum
提出日時 2023-08-18 21:24:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,536 KB
実行使用メモリ 107,520 KB
最終ジャッジ日時 2024-05-06 03:12:46
合計ジャッジ時間 4,026 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,328 KB
testcase_01 AC 36 ms
51,328 KB
testcase_02 AC 39 ms
51,456 KB
testcase_03 AC 42 ms
51,584 KB
testcase_04 AC 64 ms
73,984 KB
testcase_05 AC 127 ms
101,888 KB
testcase_06 AC 119 ms
107,264 KB
testcase_07 AC 125 ms
107,392 KB
testcase_08 AC 131 ms
101,632 KB
testcase_09 AC 37 ms
51,968 KB
testcase_10 AC 52 ms
71,424 KB
testcase_11 AC 81 ms
97,792 KB
testcase_12 AC 70 ms
88,576 KB
testcase_13 AC 63 ms
72,704 KB
testcase_14 AC 81 ms
85,376 KB
testcase_15 AC 45 ms
61,568 KB
testcase_16 AC 109 ms
102,272 KB
testcase_17 AC 56 ms
69,120 KB
testcase_18 AC 65 ms
71,040 KB
testcase_19 AC 81 ms
81,920 KB
testcase_20 AC 113 ms
103,168 KB
testcase_21 AC 93 ms
93,056 KB
testcase_22 AC 63 ms
73,216 KB
testcase_23 AC 69 ms
77,056 KB
testcase_24 AC 53 ms
65,792 KB
testcase_25 AC 115 ms
106,880 KB
testcase_26 AC 92 ms
92,928 KB
testcase_27 AC 119 ms
107,392 KB
testcase_28 AC 107 ms
98,560 KB
testcase_29 AC 97 ms
97,024 KB
testcase_30 AC 53 ms
66,304 KB
testcase_31 AC 72 ms
79,744 KB
testcase_32 AC 118 ms
107,520 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