結果

問題 No.1736 Princess vs. Dragoness
ユーザー simansiman
提出日時 2021-11-15 05:48:29
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 745 bytes
コンパイル時間 3,298 ms
コンパイル使用メモリ 142,976 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 21:32:25
合計ジャッジ時間 3,795 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cassert>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <climits>
#include <map>
#include <queue>
#include <set>
#include <cstring>
#include <vector>

using namespace std;
typedef long long ll;

int main() {
  ll N, A, B, X, Y;
  cin >> N >> A >> B >> X >> Y;
  vector<ll> H(N);
  priority_queue <ll> pque;

  for (int i = 0; i < N; ++i) {
    cin >> H[i];
    pque.push(H[i]);
  }

  for (int i = 0; i < A; ++i) {
    ll h = pque.top();
    pque.pop();
    pque.push(h - X);
  }

  ll sum = 0;
  while (not pque.empty()) {
    ll h = pque.top();
    pque.pop();
    sum += max(0LL, h);
  }

  if (sum < B * Y) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}
0