結果
| 問題 | No.2922 Rose Garden |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2024-10-13 16:27:42 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 3,000 ms |
| コード長 | 599 bytes |
| 記録 | |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 53,084 KB |
| 実行使用メモリ | 9,280 KB |
| 最終ジャッジ日時 | 2026-07-05 23:19:13 |
| 合計ジャッジ時間 | 2,906 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2922.cc: No.2922 Rose Garden - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 200000;
/* typedef */
using ll = long long;
/* global variables */
int hs[MAX_N];
/* subroutines */
/* main */
int main() {
int n, s, b;
scanf("%d%d%d", &n, &s, &b);
for (int i = 0; i < n; i++) scanf("%d", hs + i);
ll sb = (ll)s * b;
int ph = hs[0];
for (int i = 1; i < n; i++)
if (hs[i] > ph) {
if (hs[i] > ph + sb) { puts("No"); return 0; }
ph = hs[i];
}
puts("Yes");
return 0;
}
tnakao0123