結果
| 問題 |
No.2922 Rose Garden
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 15:38:58 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 694 bytes |
| コンパイル時間 | 3,821 ms |
| コンパイル使用メモリ | 276,616 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 15:39:07 |
| 合計ジャッジ時間 | 7,292 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 25 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
int main(void)
{
ll N, S, B; cin >> N >> S >> B;
vector<ll> H(N); rep(i, N) cin >> H[i];
ll ls = S, lh = H[0];
rep(i, N-1)
{
if (H[i+1] - lh <= ls * B)
{
ll ns = (H[i+1] - lh) / B;
if ((H[i+1] - lh) % B != 0) ns++;
lh += ns * B;
ls -= ns;
}
else
{
ls = S;
lh = H[i];
}
if (H[i+1] - lh <= ls * B)
{
ll ns = (H[i+1] - lh) / B;
if ((H[i+1] - lh) % B != 0) ns++;
lh += ns * B;
ls -= ns;
}
else
{
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}