結果

問題 No.2056 非力なレッド
ユーザー oshamashamaoshamashama
提出日時 2022-08-26 21:32:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 3,391 bytes
コンパイル時間 1,711 ms
コンパイル使用メモリ 169,676 KB
実行使用メモリ 6,468 KB
最終ジャッジ日時 2023-08-04 00:56:13
合計ジャッジ時間 4,990 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,388 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 52 ms
5,284 KB
testcase_14 AC 51 ms
4,880 KB
testcase_15 AC 50 ms
4,892 KB
testcase_16 AC 6 ms
4,376 KB
testcase_17 AC 36 ms
4,496 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 AC 8 ms
4,380 KB
testcase_20 AC 61 ms
5,560 KB
testcase_21 AC 13 ms
4,380 KB
testcase_22 AC 51 ms
4,848 KB
testcase_23 AC 43 ms
4,572 KB
testcase_24 AC 24 ms
4,380 KB
testcase_25 AC 62 ms
5,368 KB
testcase_26 AC 68 ms
5,684 KB
testcase_27 AC 64 ms
5,544 KB
testcase_28 AC 78 ms
6,468 KB
testcase_29 AC 79 ms
6,220 KB
testcase_30 AC 79 ms
6,352 KB
testcase_31 AC 79 ms
6,156 KB
testcase_32 AC 78 ms
6,288 KB
testcase_33 AC 79 ms
6,468 KB
testcase_34 AC 80 ms
6,356 KB
testcase_35 AC 78 ms
6,220 KB
testcase_36 AC 79 ms
6,344 KB
testcase_37 AC 80 ms
6,352 KB
testcase_38 AC 1 ms
4,376 KB
testcase_39 AC 2 ms
4,380 KB
testcase_40 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

const long long INF = 1e9;
// const long long MOD = 1e9 + 7;
const long long MOD = 998244353;
const long long LINF = 1e18;
using namespace std;

#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define dump(x) cout << #x << " = " << (x) << endl
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define COUT(x) cout << (x) << endl
#define SCOUT(x) cout << (x) << " "
#define VECCOUT(x)                              \
  for (auto &youso_ : (x))                      \
    cout << right << setw(10) << youso_ << " "; \
  cout << endl
#define ENDL cout << endl
#define CIN(...)   \
  int __VA_ARGS__; \
  CINT(__VA_ARGS__)
#define LCIN(...)        \
  long long __VA_ARGS__; \
  CINT(__VA_ARGS__)
#define SCIN(...)     \
  string __VA_ARGS__; \
  CINT(__VA_ARGS__)
#define VECCIN(x)          \
  for (auto &youso_ : (x)) \
  cin >> youso_
#define mp make_pair
#define PQ priority_queue<long long>
#define PQG priority_queue<long long, V, greater<long long>>

typedef long long ll;
typedef vector<long long> vl;
typedef vector<long long> vi;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vc> vvc;
typedef pair<long long, long long> pll;

#define COUT(x) cout << (x) << endl
void CINT()
{
}
template <class Head, class... Tail>
void CINT(Head &&head, Tail &&...tail)
{
  cin >> head;
  CINT(move(tail)...);
}
template <class T>
void mod(T &x)
{
  x %= MOD;
  x += MOD;
  x %= MOD;
}

ll GCD(ll a, ll b)
{
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}

struct COMB
{
  vl fact, fact_inv, inv;
  void init_nCk(long long SIZE)
  {
    fact.resize(SIZE + 5);
    fact_inv.resize(SIZE + 5);
    inv.resize(SIZE + 5);
    fact.at(0) = fact.at(1) = fact_inv.at(0) = fact_inv.at(1) = inv.at(1) = 1;
    for (long long i = 2; i < SIZE + 5; i++)
    {
      fact.at(i) = fact.at(i - 1) * i % MOD;
      inv.at(i) = MOD - inv.at(MOD % i) * (MOD / i) % MOD;
      fact_inv.at(i) = fact_inv.at(i - 1) * inv.at(i) % MOD;
    }
  }
  long long nCk(long long n, long long k)
  {
    assert(!(n < k));
    assert(!(n < 0 || k < 0));
    return fact.at(n) * (fact_inv.at(k) * fact_inv.at(n - k) % MOD) % MOD;
  }
};
ll extGCD(ll a, ll b, ll &x, ll &y)
{
  if (b == 0)
  {
    x = 1;
    y = 0;
    return a;
  }
  ll d = extGCD(b, a % b, y, x);
  y -= a / b * x;
  return d;
}

void Main()
{
  LCIN(N, X, M);
  vl A(N);
  VECCIN(A);
  // vl l(50, 1);
  // for (int i = 0; i < 49; i++)
  // {
  //   l.at(48 - i) = X;
  //   X = min(2 * X, MOD);
  // }
  // ll ans = 0;
  // VECCOUT(l);
  vl B(N, 0);
  for (int i = 0; i < N; i++)
  {
    while (A.at(i) >= X)
    {
      A.at(i) /= 2;
      B.at(i)++;
    }
    // dump(M);
  }
  reverse(B.begin(), B.end());
  ll ans = 0;
  for (int i = 0; i < N; i++)
  {
    if (ans < B.at(i))
      M -= (N - i) * (B.at(i) - ans);
    ans = max(ans, B.at(i));
    B.at(i) = ans;
  }
  if (M >= 0)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}

int main()
{
  cout << fixed << setprecision(15);
  Main();
  return 0;
}
0