結果

問題 No.2922 Rose Garden
ユーザー yoniha
提出日時 2024-10-12 15:19:30
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 78 ms / 3,000 ms
コード長 1,007 bytes
コンパイル時間 5,985 ms
コンパイル使用メモリ 335,344 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-10-12 15:19:40
合計ジャッジ時間 9,287 ms
ジャッジサーバーID
(参考情報)
judge4 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n - 1); i >= 0; i--)
template <typename T> bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template <typename T> bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
using ll = long long;
#define int ll
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
// using mint = modint!!!number!!!;

signed main(){
  int n, s, b; cin >> n >> s >> b;
  vi h(n); rep(i, n) cin >> h.at(i);
  vi a = {h.at(0)};
  int hmax = h.at(0);
  rep(i, n - 1) if(chmax(hmax, h.at(i + 1))) a.push_back(hmax);
  n = size(a);
  rep(i, n - 1){
  	if(a.at(i) + s * b < a.at(i + 1)){
  		cout << "No" << endl;
  		return 0;
  	}
  }
  cout << "Yes" << endl;
}
0