結果

問題 No.3758 Fan Meeting
コンテスト
ユーザー Kude
提出日時 2026-10-09 21:58:12
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 121 ms / 2,000 ms
+ 968µs
コード長 493 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 63 ms
コンパイル使用メモリ 81,288 KB
実行使用メモリ 130,580 KB
最終ジャッジ日時 2026-10-09 21:58:18
合計ジャッジ時間 4,766 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 47
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, s = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
l = 0
r = 1
def f(c):
    rest = s - 1
    cnt = 0
    for x in a:
        if cnt:
            cnt -= 1
        elif x <= c:
            return True
        elif x <= rest:
            rest -= x
            cnt = c - 1
        else:
            return False
    return True
while not f(r):
    l = r
    r *= 2
while r - l > 1:
    c = (l + r) // 2
    if f(c):
        r = c
    else:
        l = c
print(r)
0