結果

問題 No.1808 Fullgold Alchemist
コンテスト
ユーザー MasKoaTS
提出日時 2024-11-30 16:12:03
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 439 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 157 ms
コンパイル使用メモリ 84,908 KB
実行使用メモリ 108,368 KB
最終ジャッジ日時 2026-05-24 07:09:39
合計ジャッジ時間 3,947 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

n, m = map(int, input().split())
a = list(map(int, input().split()))

ok = 0
ng = 10 ** 9 + 1
while(abs(ok - ng) > 1):
    def func(mid):
        s = 0
        t = mid * m
        for i in range(n):
            s += a[i]
            if(s < t * (i + 1)):
                return False
        return True
    mid = (ok + ng) // 2
    if func(mid):
        ok = mid
    else:
        ng = mid
print(ok)
0