結果

問題 No.2424 Josouzai
ユーザー tassei903tassei903
提出日時 2023-08-15 02:34:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 173 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 109,056 KB
最終ジャッジ日時 2024-05-05 03:46:34
合計ジャッジ時間 3,840 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
51,968 KB
testcase_01 AC 36 ms
51,712 KB
testcase_02 AC 36 ms
52,096 KB
testcase_03 AC 36 ms
51,968 KB
testcase_04 AC 62 ms
74,112 KB
testcase_05 AC 118 ms
101,760 KB
testcase_06 AC 117 ms
108,672 KB
testcase_07 AC 120 ms
109,056 KB
testcase_08 AC 120 ms
102,016 KB
testcase_09 AC 35 ms
51,584 KB
testcase_10 AC 49 ms
71,680 KB
testcase_11 AC 70 ms
99,712 KB
testcase_12 AC 63 ms
89,728 KB
testcase_13 AC 58 ms
73,984 KB
testcase_14 AC 74 ms
86,656 KB
testcase_15 AC 40 ms
61,824 KB
testcase_16 AC 101 ms
104,320 KB
testcase_17 AC 52 ms
69,632 KB
testcase_18 AC 53 ms
71,552 KB
testcase_19 AC 68 ms
82,816 KB
testcase_20 AC 100 ms
104,448 KB
testcase_21 AC 86 ms
93,568 KB
testcase_22 AC 56 ms
73,216 KB
testcase_23 AC 61 ms
77,696 KB
testcase_24 AC 47 ms
66,432 KB
testcase_25 AC 105 ms
108,800 KB
testcase_26 AC 82 ms
93,824 KB
testcase_27 AC 111 ms
108,920 KB
testcase_28 AC 96 ms
99,712 KB
testcase_29 AC 93 ms
97,664 KB
testcase_30 AC 51 ms
66,304 KB
testcase_31 AC 70 ms
80,384 KB
testcase_32 AC 117 ms
108,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
#print(a, k)
i = 0
s = 0
while i < n and s + a[i] <= k:
    s += a[i]
    i += 1
print(i, k - s)
0