結果

問題 No.1808 Fullgold Alchemist
ユーザー MasKoaTS
提出日時 2024-11-30 16:30:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 1,915 ms
コンパイル使用メモリ 195,392 KB
最終ジャッジ日時 2025-02-26 09:40:43
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;


int main(){
    int n;  ll m;   cin >> n >> m;
    vector<ll> a(n);
    for(auto& x : a){
        cin >> x;
    }

    vector<ll> b = a;
    for(int i = 0; i < n - 1; ++i){
        b[i + 1] += b[i];
    }

    ll ans = a[0] / m;
    for(int i = 0; i < n; ++i){
        ll x = b[i] / (m * (i + 1));
        if(ans <= x){
            continue;
        }
        ans = x;
    }
    cout << ans << endl;

    return 0;
}
0