結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;

int main(){
  int n, x, m;
  cin >> n >> x >> m;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int cnt = 0;
  int tot = 0;
  for(int i = n-1; i >= 0; i--) {
    rep(j,cnt) {
      a[i] /= 2;
      if(a[i] == 0) break;
    }
    while(a[i] >= x) {
      cnt++;
      tot += (i+1);
      a[i] /= 2;
    }
  }
  cout << (tot <= m ? "Yes" : "No") << endl;
  return 0;
}
0