結果
問題 | No.2922 Rose Garden |
ユーザー |
|
提出日時 | 2024-10-12 16:40:54 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 68 ms / 3,000 ms |
コード長 | 563 bytes |
コンパイル時間 | 2,531 ms |
コンパイル使用メモリ | 247,676 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 16:41:01 |
合計ジャッジ時間 | 5,872 ms |
ジャッジサーバーID (参考情報) |
judge / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n,k); for(ll i = k; i < (int)(n); i++) #define rep1(i, n) for(ll i = 0; i < (n); ++i) using ll = long long; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } int main() { ll N,S,B; cin>>N>>S>>B; vector<ll>vec(N); rep(i,N,0)cin>>vec[i]; ll now=0; rep(i,N-1,0){ now=max(now,vec[i]); if(vec[i+1]>now+S*B){ cout<<"No"<<endl; return 0; } } cout<<"Yes"<<endl; }