結果

問題 No.1808 Fullgold Alchemist
ユーザー se1ka2se1ka2
提出日時 2022-01-14 21:30:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 598 bytes
コンパイル時間 687 ms
コンパイル使用メモリ 63,844 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-30 12:51:59
合計ジャッジ時間 3,129 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 32 ms
6,944 KB
testcase_06 AC 62 ms
6,940 KB
testcase_07 AC 61 ms
6,940 KB
testcase_08 AC 92 ms
6,940 KB
testcase_09 AC 89 ms
6,940 KB
testcase_10 AC 88 ms
6,944 KB
testcase_11 AC 82 ms
6,940 KB
testcase_12 AC 57 ms
6,944 KB
testcase_13 AC 59 ms
6,944 KB
testcase_14 AC 58 ms
6,940 KB
testcase_15 AC 58 ms
6,940 KB
testcase_16 AC 3 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 11 ms
6,940 KB
testcase_19 AC 3 ms
6,940 KB
testcase_20 AC 15 ms
6,944 KB
testcase_21 AC 7 ms
6,944 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 5 ms
6,940 KB
testcase_24 AC 3 ms
6,944 KB
testcase_25 AC 4 ms
6,944 KB
testcase_26 AC 13 ms
6,940 KB
testcase_27 AC 17 ms
6,940 KB
testcase_28 AC 73 ms
6,940 KB
testcase_29 AC 26 ms
6,944 KB
testcase_30 AC 23 ms
6,944 KB
testcase_31 AC 66 ms
6,940 KB
testcase_32 AC 41 ms
6,940 KB
testcase_33 AC 56 ms
6,940 KB
testcase_34 AC 72 ms
6,944 KB
testcase_35 AC 51 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;

int main()
{
    int n;
    ll m;
    cin >> n >> m;
    ll a[200005];
    for(int i = 0; i < n; i++) cin >> a[i];
    ll left = -1, right = 1000000002;
    while(right - left > 1){
        ll mid = (right + left) / 2;
        ll s = 0;
        bool f = true;
        for(int i = 0; i < n; i++){
            s += a[i];
            if(s < mid * m){
                f = false;
                break;
            }
            s -= mid * m;
        }
        if(f) left = mid;
        else right = mid;
    }
    cout << left << endl;
}
0