結果
問題 |
No.2922 Rose Garden
|
ユーザー |
|
提出日時 | 2024-10-12 14:51:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 601 bytes |
コンパイル時間 | 2,103 ms |
コンパイル使用メモリ | 191,548 KB |
最終ジャッジ日時 | 2025-02-24 17:44:58 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 25 |
ソースコード
#include <bits/stdc++.h> //#include<atcoder/all> using namespace std; //using namespace atcoder; using ll = long long; const ll mod = 1000000007; //const ll mod = 998244353; int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 }; ll n, s, b, h[200009]; int main() { cin >> n >> s >> b; for (int i = 1; i <= n; i++)cin >> h[i]; ll now = s; for (int i = 1; i <= n-1; i++) { if (h[i + 1] <= h[i])now = s; else { ll dif = h[i + 1] - h[i]; ll need = (dif + b - 1LL) / b; now -= need; if (now < 0) { cout << "No" << endl; return 0; } else now = s; } } cout << "Yes" << endl; }