結果

問題 No.1808 Fullgold Alchemist
ユーザー Kanten4205Kanten4205
提出日時 2021-12-21 00:20:39
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 1,227 bytes
コンパイル時間 2,682 ms
コンパイル使用メモリ 169,596 KB
実行使用メモリ 4,680 KB
最終ジャッジ日時 2023-10-13 19:42:58
合計ジャッジ時間 7,299 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,356 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 29 ms
4,620 KB
testcase_06 AC 58 ms
4,680 KB
testcase_07 AC 56 ms
4,676 KB
testcase_08 AC 81 ms
4,612 KB
testcase_09 AC 81 ms
4,612 KB
testcase_10 AC 81 ms
4,572 KB
testcase_11 AC 73 ms
4,560 KB
testcase_12 AC 53 ms
4,616 KB
testcase_13 AC 51 ms
4,572 KB
testcase_14 AC 54 ms
4,568 KB
testcase_15 AC 56 ms
4,652 KB
testcase_16 AC 3 ms
4,352 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 9 ms
4,372 KB
testcase_19 AC 2 ms
4,352 KB
testcase_20 AC 13 ms
4,348 KB
testcase_21 AC 6 ms
4,352 KB
testcase_22 AC 1 ms
4,352 KB
testcase_23 AC 5 ms
4,352 KB
testcase_24 AC 3 ms
4,352 KB
testcase_25 AC 3 ms
4,348 KB
testcase_26 AC 12 ms
4,352 KB
testcase_27 AC 15 ms
4,352 KB
testcase_28 AC 67 ms
4,468 KB
testcase_29 AC 22 ms
4,352 KB
testcase_30 AC 22 ms
4,352 KB
testcase_31 AC 61 ms
4,352 KB
testcase_32 AC 38 ms
4,352 KB
testcase_33 AC 49 ms
4,348 KB
testcase_34 AC 68 ms
4,372 KB
testcase_35 AC 46 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const long long MOD1 = 1000000007;
const long long MOD2 = 998244353;
typedef long long ll;
//typedef int ll;
typedef pair<ll, ll> P;
const long long INF = 1e9;
template <typename T>
void input_arr(vector<T>& A, ll N) {
	for (ll i = 0; i < N; i++) {
		cin >> A[i];
	}
}
template <typename T, typename Q>
void input_arr(vector<pair<T, Q>>& A, ll N) {
	for (ll i = 0; i < N; i++) {
		cin >> A[i].first >> A[i].second;
	}
}
template <typename T>
void input_arr(vector<vector<T>>& A, ll H, ll W) {
	for (ll i = 0; i < H; i++) {
		for (ll j = 0; j < W; j++) {
			cin >> A[i][j];
		}
	}
}
vector<P> prime_factorization(ll N) {
    vector<P>A;
    ll tmp = N;
    for (ll i = 2; i * i <= N; i++) {
        if (tmp % i == 0) {
            A.push_back({ i, 0 });
            while (tmp % i == 0) {
                A.back().second++;
                tmp /= i;
            }
        }
    }
    if (tmp != 1) A.push_back({ tmp, 1 });
    return A;
}
int main() {
    ll N, M; cin >> N >> M;
    vector<ll>A(N); input_arr(A, N);
    ll ans = INF;
    ll sum = 0;
    for (ll i = 0; i < N; i++) {
        sum += A[i];
        ans = min(ans, sum / (M * (i + 1)));
    }
    cout << ans << endl;
}
0