結果

問題 No.2150 Site Supporter
ユーザー hotman78hotman78
提出日時 2022-12-07 00:10:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 2,407 ms
コンパイル使用メモリ 196,368 KB
実行使用メモリ 7,680 KB
最終ジャッジ日時 2024-04-21 12:48:10
合計ジャッジ時間 4,283 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 13 ms
5,376 KB
testcase_09 AC 74 ms
7,168 KB
testcase_10 AC 39 ms
5,376 KB
testcase_11 AC 72 ms
6,912 KB
testcase_12 AC 29 ms
5,376 KB
testcase_13 AC 17 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 84 ms
7,680 KB
testcase_18 AC 34 ms
5,376 KB
testcase_19 AC 12 ms
5,376 KB
testcase_20 AC 56 ms
6,144 KB
testcase_21 AC 8 ms
5,376 KB
testcase_22 AC 75 ms
7,168 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 48 ms
5,504 KB
testcase_28 AC 47 ms
5,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using lint=long long;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(n) (n).begin(),(n).end()

int main(){
    lint n,k,x;
    cin>>n>>k>>x;
    vector<lint> a(n),s(n+1),t(n+1,1LL<<60);
    rep(i,n)cin>>a[i];
    rep(i,n){
        s[i+1]=(min(s[i],t[i])+a[i]);
        t[i+1]=min(s[i]+k+x,t[i]+k);
    }
    cout<<min(s.back(),t.back())<<endl;;
}
0