結果

問題 No.1736 Princess vs. Dragoness
ユーザー forest3
提出日時 2021-11-14 21:32:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 479 bytes
コンパイル時間 1,625 ms
コンパイル使用メモリ 171,900 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-11-30 06:35:11
合計ジャッジ時間 11,738 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30 TLE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N, A, B, X;
	long long Y;
	cin >> N >> A >> B >> X >> Y;
	priority_queue<int> q;
	for( int i = 0; i < N; i++ ) {
		int H;
		cin >> H;
		q.push( H );
	}

	for( int i = 0; i < A; i++ ) {
		int H = q.top();
		q.pop();
		H -= X;
		if( H > 0 ) q.push( H );
	}
	long long s = 0;
	while( q.size() ) {
		int H = q.top();
		q.pop();
		s += H;
	}
	string ans = "Yes";
	if( s > Y * B ) ans = "No";

	cout << ans << endl;
}


0