結果

問題 No.3758 Fan Meeting
コンテスト
ユーザー Unbakedbread
提出日時 2026-10-10 15:40:35
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 120 ms / 2,000 ms
+ 227µs
コード長 306 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 109 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 132,824 KB
最終ジャッジ日時 2026-10-10 15:41:08
合計ジャッジ時間 6,022 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 47
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N, S = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse = True)

def check(X):
	i, T = 0, 1
	while i < N and A[i] > X:
		T += A[i]
		i += X
	return T <= S
	
ng, ok = 0, 10 ** 10
while ok - ng > 1:
	mid = (ok + ng) // 2
	ok, ng = (mid, ng) if check(mid) else (ok, mid)
print(ok)
0