結果
| 問題 |
No.2922 Rose Garden
|
| コンテスト | |
| ユーザー |
Ayuna
|
| 提出日時 | 2024-10-19 16:55:21 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 87 ms / 3,000 ms |
| コード長 | 495 bytes |
| コンパイル時間 | 714 ms |
| コンパイル使用メモリ | 74,856 KB |
| 最終ジャッジ日時 | 2025-02-24 21:35:56 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 |
ソースコード
#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] - now;
ll need = (diff + b - 1) / b;
if (need > st){
cout << "No" << endl;
return 0;
}
st = s;
now = h[i + 1];
}
cout << "Yes" << endl;
}
Ayuna