結果
問題 |
No.2056 非力なレッド
|
ユーザー |
👑 |
提出日時 | 2023-04-21 13:13:28 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 93 ms / 2,000 ms |
コード長 | 395 bytes |
コンパイル時間 | 731 ms |
コンパイル使用メモリ | 72,404 KB |
最終ジャッジ日時 | 2025-02-12 10:54:39 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int n,x,m;cin>>n>>x>>m; vector<int> A(n); int cost = 0; for(int i = 0; n > i; i++)cin>>A[i]; int nw = 1; for(int i = n-1; 0 <= i; i--){ while(x <= A[i]/nw){ nw *= 2; cost += i+1; } } if(cost > m)cout << "No" << endl; else cout << "Yes" << endl; }