結果
問題 | No.2922 Rose Garden |
ユーザー |
![]() |
提出日時 | 2024-10-19 16:53:56 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 496 bytes |
コンパイル時間 | 830 ms |
コンパイル使用メモリ | 75,000 KB |
最終ジャッジ日時 | 2025-02-24 21:35:41 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 25 |
ソースコード
#include <iostream>#include <vector>#include <map>using namespace std;using ll = long long;int main(){int n, s;ll b;cin >> n >> s >> b;vector<ll> h(n);for (ll &i: h) cin >> i;ll now = h[0];ll st = s;for (int i = 0; i < n - 1; i++){if (now >= h[i + 1]) continue;ll diff = h[i + 1] - h[i];ll need = (diff + b - 1) / b;if (need > st){cout << "No" << endl;return 0;}st = s;now = h[i + 1];}cout << "Yes" << endl;}