結果

問題 No.1808 Fullgold Alchemist
ユーザー H3PO4
提出日時 2022-01-14 21:30:11
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 320 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 32,760 KB
最終ジャッジ日時 2024-11-20 07:56:33
合計ジャッジ時間 6,643 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
A = tuple(map(int, input().split()))


def isOK(x):
    cur = 0
    for a in A:
        cur += a - x
        if cur < 0:
            return False
    return True


l, r = 0, 10 ** 9
while r - l > 1:
    m = (r + l) // 2
    if isOK(m * M):
        l = m
    else:
        r = m
print(l)
0