結果
問題 |
No.1736 Princess vs. Dragoness
|
ユーザー |
![]() |
提出日時 | 2021-11-12 21:45:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 639 bytes |
コンパイル時間 | 1,733 ms |
コンパイル使用メモリ | 171,940 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-25 17:49:39 |
合計ジャッジ時間 | 2,785 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int,int>; #define rep(i, n) for(int i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() int main(){ ll n,a,b,x,y; cin >> n >> a >> b >> x >> y; priority_queue<ll> h; rep(i,n){ ll z; cin >> z; h.push(z); } rep(i,a){ if(h.empty()) break; ll hmax = h.top() - x; h.pop(); if(hmax>0) h.push(hmax); } ll tot = 0; while(h.size()){ tot += h.top(); h.pop(); } if(tot <= b*y) cout << "Yes" << endl; else cout << "No" << endl; return 0; }