結果
問題 | No.2056 非力なレッド |
ユーザー |
![]() |
提出日時 | 2022-08-26 23:21:01 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 948 bytes |
コンパイル時間 | 1,205 ms |
コンパイル使用メモリ | 116,932 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-14 00:05:33 |
合計ジャッジ時間 | 3,947 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 WA * 9 |
ソースコード
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<map> #include<math.h> #include<set> #define all(x) x.begin(),x.end() #define gall(x) x.begin(),x.end(),greater<>() #define pb push_back #define ll long long #define P pair<int,int> #define LP pair<ll,ll> using namespace std; int main() { int n, x, m, magic; P ma; ll cnt=0; cin >> n >> x >> m; bool f = 1; vector<P> a(n); for (int i = 0; i < n; i++) { cin >> a[i].first; a[i].second = i; ma.first = max(ma.first, a[i].first); if (ma.first == a[i].first) ma.second = a[i].second; } magic = min(n, m); if (magic < ma.second + 1) f = 0; ma.first = 0; for (int i = 0; i < magic; i++) { a[i].first/=2; ma.first = max(ma.first, a[i].first); } m -= magic; if (x < ma.first) f = 0; if (f) cout << "Yes" << endl; else cout << "No" << endl; return 0; }