結果
| 問題 |
No.2922 Rose Garden
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 15:30:30 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 511 bytes |
| コンパイル時間 | 3,535 ms |
| コンパイル使用メモリ | 275,640 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 15:30:47 |
| 合計ジャッジ時間 | 7,139 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
{
ls--;
lh += B;
}
else if (H[i+1] - H[i] > S * B)
{
cout << "No" << endl;
return 0;
}
else
{
ls = S;
lh = H[i+1];
}
}
cout << "Yes" << endl;
return 0;
}