結果

問題 No.2922 Rose Garden
ユーザー elphe
提出日時 2024-10-22 17:01:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 39 ms / 3,000 ms
コード長 473 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 71,916 KB
最終ジャッジ日時 2025-02-24 22:17:41
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>
#include <vector>

using namespace std;

int main()
{
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	uint32_t N, S, B, i;
	cin >> N >> S >> B;
	vector<uint32_t> H(N);
	for (i = 0; i != N; ++i)
		cin >> H[i];

	uint32_t highest = H[0];
	for (i = 1; i != N; ++i)
	{
		if (highest + S * static_cast<uint64_t>(B) < H[i])
		{
			cout << "No\n";
			return 0;
		}

		if (highest < H[i]) highest = H[i];
	}

	cout << "Yes\n";
	return 0;
}
0