結果

問題 No.2922 Rose Garden
ユーザー k82b
提出日時 2024-10-12 14:46:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 87 ms / 3,000 ms
コード長 335 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 67,600 KB
最終ジャッジ日時 2025-02-24 17:42:09
ジャッジサーバーID
(参考情報)
judge2 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using Int = long long;
int main() {
	int N, S, B;
	std::cin >> N >> S >> B;
	int H[N];
	for (int i = 0; i < N; ++i) std::cin >> H[i];
	bool ans = true;
	Int X = 0;
	for (int i = 0; i < N - 1; ++i) {
		X = std::max(X, H[i] + Int(S) * B);
		ans &= X >= H[i + 1];
	}
	std::cout << (ans ? "Yes" : "No") << std::endl;
}
0