結果

問題 No.1808 Fullgold Alchemist
ユーザー wgrapewgrape
提出日時 2023-10-31 17:06:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 261 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 103,552 KB
最終ジャッジ日時 2024-09-25 17:41:34
合計ジャッジ時間 3,803 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
A = list(map(int,input().split()))
target = sum(A) // (N * M) # 最大で作れる個数
for i in range(N - 1):
    if A[i] < target * M:
        target = A[i] // M
    A[i + 1] += A[i] - target * M
print(min(target, A[-1] // M))
0