結果

問題 No.2056 非力なレッド
ユーザー t98slidert98slider
提出日時 2022-08-26 21:27:47
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 563 bytes
コンパイル時間 1,606 ms
コンパイル使用メモリ 166,260 KB
実行使用メモリ 6,492 KB
最終ジャッジ日時 2023-08-04 00:49:40
合計ジャッジ時間 5,923 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 92 ms
5,092 KB
testcase_14 AC 92 ms
4,832 KB
testcase_15 AC 91 ms
4,960 KB
testcase_16 AC 10 ms
4,388 KB
testcase_17 AC 64 ms
4,420 KB
testcase_18 AC 5 ms
4,376 KB
testcase_19 AC 13 ms
4,376 KB
testcase_20 AC 110 ms
5,400 KB
testcase_21 AC 23 ms
4,376 KB
testcase_22 AC 90 ms
5,016 KB
testcase_23 AC 76 ms
4,688 KB
testcase_24 AC 42 ms
4,380 KB
testcase_25 AC 113 ms
5,540 KB
testcase_26 AC 121 ms
5,740 KB
testcase_27 AC 115 ms
5,420 KB
testcase_28 AC 142 ms
6,208 KB
testcase_29 AC 142 ms
6,328 KB
testcase_30 AC 144 ms
6,192 KB
testcase_31 AC 142 ms
6,492 KB
testcase_32 AC 142 ms
6,336 KB
testcase_33 AC 144 ms
6,152 KB
testcase_34 AC 143 ms
6,196 KB
testcase_35 AC 143 ms
6,336 KB
testcase_36 AC 143 ms
6,216 KB
testcase_37 AC 143 ms
6,340 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 2 ms
4,380 KB
testcase_40 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ll n, x, m;
    cin >> n >> x >> m;
    vector<ll> a(n), b(n, 32);
    for(int i = 0; i < n; i++){
        cin >> a[i];
        for(int j = 0; j < 30; j++){
            ll d = 1ll << j;
            if(a[i] / d < x)b[i] = min(b[i], (ll)(j));
        }
    }
    ll ans = 0, maxv = 0;
    for(int i = n - 1; i >= 0; i--){
        if(b[i] > maxv){
            ans += (b[i] - maxv) * (i + 1);
            maxv = b[i];
        }
    }
    cout << (ans <= m ? "Yes" : "No") << '\n';
}
0