結果

問題 No.2922 Rose Garden
ユーザー rotti_coder
提出日時 2024-10-12 14:42:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 103 ms / 3,000 ms
コード長 382 bytes
コンパイル時間 721 ms
コンパイル使用メモリ 71,516 KB
最終ジャッジ日時 2025-02-24 17:40:17
ジャッジサーバーID
(参考情報)
judge4 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
using namespace std;
int main()
{
  long long n,s,b;
  cin >> n >> s >> b;
  vector<long long>h(n);
  for(int i=0;i<n;i++)cin >> h[i];
  long long now=h[0]+s*b;
  bool ok=true;
  for(int i=1;i<n;i++){
    if(now<h[i]){
      ok=false;
      break;
    }
    now=max(now,h[i]+s*b);
  }
  if(ok)cout << "Yes" << endl;
  else cout << "No" << endl;
}
0