結果
問題 |
No.2922 Rose Garden
|
ユーザー |
|
提出日時 | 2024-10-12 14:48:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 80 ms / 3,000 ms |
コード長 | 397 bytes |
コンパイル時間 | 1,674 ms |
コンパイル使用メモリ | 169,044 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 14:48:48 |
合計ジャッジ時間 | 5,010 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long signed main() { int n,s,b; cin >> n >> s >> b; vector<int> a(n); cin >> a[0]; int t = a[0], e = s; for(int i = 1; i < n; i++) { cin >> a[i]; if(e*b < a[i]-t) { cout << "No" << endl; return 0; } if(a[i]+s*b >= t+e*b) { t = a[i]; e = s; } else { t = t+e*b; e = 0; } } cout << "Yes" << endl; }