結果
| 問題 |
No.2056 非力なレッド
|
| コンテスト | |
| ユーザー |
やう
|
| 提出日時 | 2022-08-26 21:29:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 676 bytes |
| コンパイル時間 | 1,685 ms |
| コンパイル使用メモリ | 175,568 KB |
| 実行使用メモリ | 22,656 KB |
| 最終ジャッジ日時 | 2024-10-13 21:54:56 |
| 合計ジャッジ時間 | 9,720 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 7 TLE * 1 -- * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
using V=vector<ll>;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
int main(){
ll n,x,m;
cin >> n >> x >> m;
V a(n);
set<P> s;
rep(i,n){
cin >> a[i];
s.insert(P(a[i],i));
}
while(m){
auto i=s.end(); --i;
int k=min(m,(*i).second+1);
rep(j,k){
s.erase(P(a[j],j));
a[j]/=2;
s.insert(P(a[j],j));
}
m-=k;
}
ll M=0;
rep(i,n) M=max(M,a[i]);
if(x<M) cout << "No" << endl;
else cout << "Yes" << endl;
}
やう