結果

問題 No.2922 Rose Garden
ユーザー elphe
提出日時 2024-10-22 16:51:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 658 bytes
コンパイル時間 753 ms
コンパイル使用メモリ 78,376 KB
最終ジャッジ日時 2025-02-24 22:17:37
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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];

	if (N == 1)
	{
		cout << "Yes\n";
		return 0;
	}

	sort(H.begin() + 1, H.end() - 1);

	i = lower_bound(H.begin() + 1, H.end() - 1, H[0]) - H.begin();
	if (H[0] + S * static_cast<uint64_t>(B) < H[i])
	{
		cout << "No\n";
		return 0;
	}

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

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