結果

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

ソースコード

diff #

import sys
input = sys.stdin.readline

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

OK=0
NG=max(A)

while NG>OK+1:
    mid=(OK+NG)//2

    now=0
    for a in A:
        now+=a
        now-=mid

        if now<0:
            NG=mid
            break
    else:
        OK=mid

print(OK//M)
0