結果
問題 |
No.1736 Princess vs. Dragoness
|
ユーザー |
👑 |
提出日時 | 2021-12-25 11:32:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 707 bytes |
コンパイル時間 | 712 ms |
コンパイル使用メモリ | 76,644 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-21 13:33:01 |
合計ジャッジ時間 | 1,912 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <queue> using namespace std; int main(){ long long n,a,b,x,y;cin>>n>>a>>b>>x>>y; priority_queue<long long,vector<long long>> A; for(int i = 0; n > i; i++){ long long t;cin>>t; A.push(t); } while(a){ if(A.size() == 0){ cout << "Yes" << endl; return 0; } auto z = A.top();A.pop(); if(z > x){ A.push(z-x); } a--; } long long size = 0; while(A.size()){ auto z = A.top();A.pop(); size+=z; } if(size > b*y){ cout << "No" << endl; }else{ cout << "Yes" << endl; } }