結果

問題 No.2056 非力なレッド
ユーザー zezerozezero
提出日時 2022-08-26 21:41:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 771 bytes
コンパイル時間 3,467 ms
コンパイル使用メモリ 159,512 KB
最終ジャッジ日時 2025-01-31 04:30:53
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int main(){
  int n;
  ll x,m;
  cin >> n >> x >> m;
  vector<ll> a(n);
  vector<ll> count(n);
  rep(i,n) cin >> a[i];
  rep(i,n){
    ll z = a[i];
    while (z >= x){
      count[i]++;
      z >>=1LL;
    }
  }
  ll now = 0;
  for (int i = n-1;i >= 0;i--){
    m -= max(0LL,count[i]*(i+1)-now);
    now += max(0LL,count[i]*(i+1)-now);
    if (m < 0){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  

  return 0;
}
0