結果
問題 | No.2056 非力なレッド |
ユーザー |
|
提出日時 | 2022-08-26 22:18:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 991 bytes |
コンパイル時間 | 741 ms |
コンパイル使用メモリ | 92,476 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 22:56:05 |
合計ジャッジ時間 | 3,429 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include <iostream>#include <vector>#include <map>#include <queue>#include <algorithm>#include <set>#include <cmath>#include <bitset>#include <fstream>using namespace std;int main() {int n,x,m;cin >> n >> x >> m;vector<int> a(n);for(int i=0;i<n;i++) cin >> a[i];while(m){for(int i=n-1;0<=i;i--){if(x<=a[i]){for(int j=i;0<=j;j--){a[j]/=2;}m-=i+1;break;}}if(m<0) break;bool flag = true;for(int i=0;i<n;i++){if(x<=a[i]) flag = false;}if(flag) {cout << "Yes" << endl;return 0;}}if(0<=m){bool flag = true;for(int i=0;i<n;i++){if(x<=a[i]) flag = false;}if(flag) {cout << "Yes" << endl;return 0;}}cout << "No" << endl;}