結果

問題 No.1808 Fullgold Alchemist
ユーザー koryoukoryou
提出日時 2022-01-14 21:45:22
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 1,292 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 91,732 KB
実行使用メモリ 5,192 KB
最終ジャッジ日時 2023-08-12 18:50:16
合計ジャッジ時間 3,682 ms
ジャッジサーバーID
(参考情報)
judge2 / judge7
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 30 ms
5,192 KB
testcase_06 AC 62 ms
5,164 KB
testcase_07 AC 58 ms
4,996 KB
testcase_08 AC 86 ms
4,908 KB
testcase_09 AC 87 ms
5,064 KB
testcase_10 AC 87 ms
4,912 KB
testcase_11 AC 81 ms
4,916 KB
testcase_12 AC 58 ms
5,096 KB
testcase_13 AC 58 ms
4,936 KB
testcase_14 AC 59 ms
4,936 KB
testcase_15 AC 58 ms
5,020 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 11 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 14 ms
4,376 KB
testcase_21 AC 6 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 5 ms
4,376 KB
testcase_24 AC 3 ms
4,376 KB
testcase_25 AC 3 ms
4,376 KB
testcase_26 AC 12 ms
4,376 KB
testcase_27 AC 16 ms
4,380 KB
testcase_28 AC 72 ms
4,796 KB
testcase_29 AC 24 ms
4,376 KB
testcase_30 AC 22 ms
4,380 KB
testcase_31 AC 64 ms
4,632 KB
testcase_32 AC 40 ms
4,376 KB
testcase_33 AC 53 ms
4,504 KB
testcase_34 AC 71 ms
4,748 KB
testcase_35 AC 49 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <string>
#include <list>
#include <cassert>
#include <numeric>
#include <cstdint>
#include <queue>
#include <deque>
#include <stack>
#include <set>
// #include <atcoder/all>
 
using ll = long long;
using ld = long double;
using namespace std;
// using namespace atcoder;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using Priority = priority_queue<ll, vector<ll>, greater<ll>>;// 昇順
using Priority_pair = priority_queue<P, vector<P>, greater<P>>;
// using mint_17 = modint1000000007;
// using mint = modint998244353;

// typedef pair<int,int> P;
#define mod 1000000007
#define MAX_WIDTH 60
#define MAX_HEIGHT 60
#define INF 1e18
#define MOD 998244353
#define PI 3.141592653589793

ll N, M, A[200010];
int main(){
    cin >> N >> M;
    for(int i=0;i<N;i++) {
        cin >> A[i];
    }

    ll sum = 0, ave = 0, ans = INF;
    for(int i=0;i<N;i++) {
        sum += A[i];

        if(sum == 0) {
            cout << 0 << endl;
            return 0;
        }

        ave = sum / (i+1);

        if(ave == 0) {
            cout << 0 << endl;
            return 0;
        }

        ans = min(ans, ave / M);
    }
    cout << ans << endl;

    return 0;
}
0