結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-20 15:48:01 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 618 bytes |
| コンパイル時間 | 3,541 ms |
| コンパイル使用メモリ | 253,416 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-07-04 14:07:34 |
| 合計ジャッジ時間 | 4,594 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;
int main() {
ll N, A, B, X, Y; cin >> N >> A >> B >> X >> Y;
priority_queue<ll> pq;
for (int i = 0; i < N; i++) {
ll h; cin >> h;
pq.push(h);
}
for (int i = 0; i < A; i++) {
ll h = pq.top(); pq.pop();
pq.push(max(0LL, h - X));
}
ll sum = 0;
while (!pq.empty()) {
ll h = pq.top(); pq.pop();
sum += h;
}
if (sum <= B * Y) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}