結果

問題 No.2424 Josouzai
ユーザー hiro1729hiro1729
提出日時 2023-09-08 20:24:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 172 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 103,392 KB
最終ジャッジ日時 2023-09-08 20:24:10
合計ジャッジ時間 5,879 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,092 KB
testcase_01 AC 67 ms
70,988 KB
testcase_02 AC 70 ms
71,348 KB
testcase_03 AC 69 ms
71,024 KB
testcase_04 AC 93 ms
84,160 KB
testcase_05 AC 152 ms
101,084 KB
testcase_06 AC 153 ms
101,424 KB
testcase_07 AC 153 ms
101,360 KB
testcase_08 AC 154 ms
101,316 KB
testcase_09 AC 68 ms
71,060 KB
testcase_10 AC 81 ms
83,524 KB
testcase_11 AC 110 ms
103,392 KB
testcase_12 AC 95 ms
96,768 KB
testcase_13 AC 93 ms
83,852 KB
testcase_14 AC 110 ms
92,856 KB
testcase_15 AC 73 ms
76,028 KB
testcase_16 AC 140 ms
99,512 KB
testcase_17 AC 86 ms
80,848 KB
testcase_18 AC 90 ms
82,632 KB
testcase_19 AC 103 ms
90,472 KB
testcase_20 AC 144 ms
99,660 KB
testcase_21 AC 126 ms
98,528 KB
testcase_22 AC 91 ms
84,192 KB
testcase_23 AC 95 ms
86,796 KB
testcase_24 AC 80 ms
78,776 KB
testcase_25 AC 147 ms
101,520 KB
testcase_26 AC 119 ms
98,156 KB
testcase_27 AC 149 ms
100,224 KB
testcase_28 AC 131 ms
101,804 KB
testcase_29 AC 127 ms
101,528 KB
testcase_30 AC 81 ms
79,288 KB
testcase_31 AC 99 ms
89,004 KB
testcase_32 AC 149 ms
100,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(n):
	s += a[i]
	if s > k:
		s -= a[i]
		exit(print(i, k - s))
print(n, 0)
0