結果

問題 No.1808 Fullgold Alchemist
ユーザー titiatitia
提出日時 2022-01-14 21:34:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 362 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 32,544 KB
最終ジャッジ日時 2024-11-20 08:10:28
合計ジャッジ時間 13,513 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

OK=0
NG=max(A)+1

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

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

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

print(OK)
0