結果

問題 No.2922 Rose Garden
ユーザー momoyuu
提出日時 2024-10-13 17:23:07
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 22 ms / 3,000 ms
コード長 477 bytes
コンパイル時間 904 ms
コンパイル使用メモリ 94,292 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 17:23:12
合計ジャッジ時間 3,244 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    ll n,s,b;
    cin>>n>>s>>b;
    vector<ll> h(n);
    
    for(int i = 0;i<n;i++) cin>>h[i];
    ll now = h[0];
    for(int i = 0;i<n;i++){
        if(now<h[i]){
            cout<<"No\n";
            return 0;
        }
        ll can = h[i] + b * s;
        now = max(now,can);
    }
    cout<<"Yes\n";
}
0