結果

問題 No.3758 Fan Meeting
コンテスト
ユーザー yuuDot
提出日時 2026-10-10 22:12:16
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 516 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 951 ms
コンパイル使用メモリ 80,640 KB
実行使用メモリ 132,232 KB
最終ジャッジ日時 2026-10-10 22:12:35
合計ジャッジ時間 8,418 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, s = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)


def solve(x):
    # x時間以内に終わるか?
    crr_s = 0
    cnt = 0
    for i in range(n):
        if cnt == 0:
            crr_s += a[i]

        cnt += 1
        cnt %= x

    return crr_s < s


if max(a) >= s:
    print(max(a))
else:
    ok = 10**18 + 5
    ng = 0
    while ok - ng > 1:
        mid = (ok + ng) // 2
        if solve(mid):
            ok = mid
        else:
            ng = mid

    print(ok)
0