結果

問題 No.2056 非力なレッド
ユーザー marc2825marc2825
提出日時 2022-08-26 21:38:47
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 2,145 bytes
コンパイル時間 1,751 ms
コンパイル使用メモリ 125,628 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-04-21 23:38:02
合計ジャッジ時間 4,537 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 60 ms
5,504 KB
testcase_14 AC 62 ms
5,376 KB
testcase_15 AC 56 ms
5,504 KB
testcase_16 AC 7 ms
5,376 KB
testcase_17 AC 42 ms
5,376 KB
testcase_18 AC 5 ms
5,376 KB
testcase_19 AC 9 ms
5,376 KB
testcase_20 AC 70 ms
5,888 KB
testcase_21 AC 16 ms
5,376 KB
testcase_22 AC 67 ms
5,376 KB
testcase_23 AC 63 ms
5,376 KB
testcase_24 AC 27 ms
5,376 KB
testcase_25 AC 72 ms
6,016 KB
testcase_26 AC 81 ms
6,272 KB
testcase_27 AC 76 ms
5,888 KB
testcase_28 AC 88 ms
6,528 KB
testcase_29 AC 94 ms
6,656 KB
testcase_30 AC 97 ms
6,528 KB
testcase_31 AC 91 ms
6,528 KB
testcase_32 AC 90 ms
6,528 KB
testcase_33 AC 98 ms
6,528 KB
testcase_34 AC 98 ms
6,656 KB
testcase_35 AC 90 ms
6,656 KB
testcase_36 AC 90 ms
6,528 KB
testcase_37 AC 104 ms
6,784 KB
testcase_38 AC 3 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <functional>
#include <queue>
#include <stack>
#include <list>
#include <deque>
#include <utility>
#include <numeric>
#include <set>
#include <map>
#include <complex>
#include <cctype>
#include <climits>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <time.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using uint = unsigned;
using vi = vector<int>;
using vl = vector<long>;
using vll = vector<long long>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvll = vector<vll>;
using vc = vector<char>;
using vs = vector<string>;
using vb = vector<bool>;
using pii = pair<int, int>;
using pcc = pair<char, char>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;
using vpii = vector<pii>;
using vpll = vector<pll>;

typedef complex<double> xy_t;

#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define repback(i, n) for (ll i = n-1; i >= 0; i--)
#define REP(i, a, b) for (ll i = a; i < ll(b); i++)
#define REPBACK(i, a, b) for (ll i = a-1; i >= ll(b); i--)
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << "debug:" << x << endl

static const double pi = acos(-1.0);
const long long INFL = pow(10,18);
const long long INFLMAX = 9223372036854775807;
const int INF = pow(10,9);
const int INFMAX = 2147483647;
const int mod1 = 1000000007;
const int mod2 = 998244353;
const vi dx = {1,0,-1,0};
const vi dy = {0,1,0,-1};
const vi dx2 = {0, 1, 0, -1, 1, -1, 1, -1};
const vi dy2 = {1, 0, -1, 0, 1, 1, -1, -1};


int main(){
    ll N,X,M; cin >> N >> X >> M;
    vll A(N);
    vll need(N);
    rep(i,N){
        cin >> A[i];
        int tmp = 0;
        while(A[i] / pow(2, tmp) >= X) tmp++;
        need[i] = tmp;
    }

    ll maxnow = 0;
    repback(i,N){
        //debug(M);
        if(maxnow < need[i]) {
            M -= (need[i] - maxnow) * (i+1);
            maxnow = need[i];
        }
    }

    if(M >= 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    
}
0