結果

問題 No.1808 Fullgold Alchemist
ユーザー CleyLCleyL
提出日時 2022-01-24 00:16:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 626 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 68,420 KB
実行使用メモリ 4,904 KB
最終ジャッジ日時 2023-08-20 06:59:38
合計ジャッジ時間 3,662 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 30 ms
4,696 KB
testcase_06 AC 58 ms
4,856 KB
testcase_07 AC 58 ms
4,708 KB
testcase_08 AC 87 ms
4,636 KB
testcase_09 AC 88 ms
4,904 KB
testcase_10 AC 88 ms
4,896 KB
testcase_11 AC 82 ms
4,652 KB
testcase_12 AC 54 ms
4,716 KB
testcase_13 AC 57 ms
4,896 KB
testcase_14 AC 57 ms
4,596 KB
testcase_15 AC 57 ms
4,712 KB
testcase_16 AC 3 ms
4,384 KB
testcase_17 AC 2 ms
4,384 KB
testcase_18 AC 10 ms
4,384 KB
testcase_19 AC 3 ms
4,384 KB
testcase_20 AC 14 ms
4,384 KB
testcase_21 AC 6 ms
4,384 KB
testcase_22 AC 2 ms
4,384 KB
testcase_23 AC 5 ms
4,384 KB
testcase_24 AC 3 ms
4,384 KB
testcase_25 AC 3 ms
4,384 KB
testcase_26 AC 12 ms
4,380 KB
testcase_27 AC 16 ms
4,380 KB
testcase_28 AC 70 ms
4,384 KB
testcase_29 AC 24 ms
4,380 KB
testcase_30 AC 23 ms
4,380 KB
testcase_31 AC 62 ms
4,380 KB
testcase_32 AC 39 ms
4,388 KB
testcase_33 AC 53 ms
4,380 KB
testcase_34 AC 71 ms
4,584 KB
testcase_35 AC 48 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
    long long n,m;cin>>n>>m;
    vector<long long> A(n);
    for(int i = 0; n > i; i++){
        cin>>A[i];
    }
    long long mn = 0;
    long long mx = A[0]+1;
    while(mx-mn > 1){
        long long ce = (mn+mx)/2;
        long long nw = 0;
        bool ok = true;
        for(int i = 0; n > i; i++){
            if(A[i]+nw < ce){
                ok = false;
                break;
            }
            nw = A[i]+nw-ce;
        }
        if(ok){
            mn = ce;
        }else{
            mx = ce;
        }
    }
    cout << mn/m << endl;
}
0