結果
問題 |
No.1736 Princess vs. Dragoness
|
ユーザー |
|
提出日時 | 2024-04-20 15:48:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 618 bytes |
コンパイル時間 | 4,383 ms |
コンパイル使用メモリ | 253,300 KB |
最終ジャッジ日時 | 2025-02-21 06:46:57 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#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; }