結果

問題 No.1808 Fullgold Alchemist
ユーザー gr1msl3y
提出日時 2022-01-14 23:05:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 103,296 KB
最終ジャッジ日時 2024-11-20 13:48:28
合計ジャッジ時間 3,958 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

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


def solve(k):
    ct = 0
    for a in A:
        ct += a-k*M
        if ct < 0:
            return False
    else:
        return True


ok, ng = 0, 10**9+1
while ng-ok > 1:
    m = (ng+ok)//2
    if solve(m):
        ok = m
    else:
        ng = m
print(ok)
0