結果
問題 |
No.2922 Rose Garden
|
ユーザー |
![]() |
提出日時 | 2024-10-12 14:42:23 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 597 bytes |
コンパイル時間 | 2,892 ms |
コンパイル使用メモリ | 247,056 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 14:42:38 |
合計ジャッジ時間 | 5,430 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 45 WA * 5 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; template <class T> using V=vector<T>; template <class T> using VV=V<V<T>>; int dp[200200]; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n,s,b; cin>>n>>s>>b; V<ll> H(n); rep(i,n) cin>>H[i]; dp[0]=1; rep(i,n-1){ if(dp[i]==0) continue; for(int j=1;j<=s && i+j<=n-1;j++){ if(H[i+j]>H[i]+s*b) break; dp[i+j]=1; } } if(dp[n-1]) cout<<"Yes\n"; else cout<<"No\n"; return 0; }