結果

問題 No.2056 非力なレッド
ユーザー んんんんんん
提出日時 2022-08-26 21:33:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 727 bytes
コンパイル時間 2,135 ms
コンパイル使用メモリ 166,300 KB
実行使用メモリ 6,232 KB
最終ジャッジ日時 2024-04-21 23:31:49
合計ジャッジ時間 4,912 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 53 ms
5,376 KB
testcase_14 WA -
testcase_15 AC 48 ms
5,376 KB
testcase_16 WA -
testcase_17 AC 37 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 60 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 53 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 25 ms
5,376 KB
testcase_25 AC 65 ms
5,376 KB
testcase_26 AC 69 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 76 ms
5,376 KB
testcase_29 WA -
testcase_30 AC 82 ms
5,376 KB
testcase_31 WA -
testcase_32 AC 80 ms
5,376 KB
testcase_33 AC 83 ms
6,232 KB
testcase_34 WA -
testcase_35 AC 83 ms
5,376 KB
testcase_36 AC 83 ms
5,376 KB
testcase_37 AC 88 ms
6,068 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 WA -
testcase_40 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int N, X, M;
int A[200009];

int main() {
    cin >> N >> X >> M;
    for (int i = 0; i < N; i++) cin >> A[i];
    vector<pair<int, int>> vp;
    for (int i = 0; i < N; i++) {
        if (A[i] >= X) {
            int cnt = 0;
            int val = 1;
            while (A[i]-X >= val) {
                cnt++;
                val *= 2;
            }
            vp.emplace_back(cnt, i+1);
        }
    }
    int sum_cnt = 0;
    int cost = 0;
    for (int i = vp.size()-1; i >= 0; i--) {
        cost += max(0, vp[i].second * (vp[i].first-sum_cnt));
        sum_cnt += max(0, vp[i].second-sum_cnt);
    }
    if (cost <= M) cout << "Yes" << endl;
    else cout << "No" << endl;
}
0