結果

問題 No.2056 非力なレッド
ユーザー やうやう
提出日時 2022-08-26 21:39:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 741 bytes
コンパイル時間 1,829 ms
コンパイル使用メモリ 171,520 KB
実行使用メモリ 17,536 KB
最終ジャッジ日時 2024-04-21 23:40:03
合計ジャッジ時間 15,466 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,248 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 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 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 241 ms
12,288 KB
testcase_15 WA -
testcase_16 AC 27 ms
5,376 KB
testcase_17 AC 149 ms
9,344 KB
testcase_18 AC 16 ms
5,376 KB
testcase_19 AC 56 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 131 ms
5,404 KB
testcase_22 AC 261 ms
12,032 KB
testcase_23 AC 282 ms
10,624 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 1,402 ms
17,408 KB
testcase_29 TLE -
testcase_30 AC 1,244 ms
17,280 KB
testcase_31 TLE -
testcase_32 TLE -
testcase_33 WA -
testcase_34 AC 507 ms
17,280 KB
testcase_35 WA -
testcase_36 AC 274 ms
17,280 KB
testcase_37 AC 380 ms
17,280 KB
testcase_38 WA -
testcase_39 AC 1 ms
5,376 KB
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
using V=vector<ll>;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)

int main(){
    ll n,x,m;
    cin >> n >> x >> m;
    V a(n);
    set<P> s;
    rep(i,n){
        cin >> a[i];
        s.insert(P(a[i],i));
    }

    ll M;

    while(m){
        auto i=s.end(); --i;
        int k=min(m,(*i).second+1);
        rep(j,k){
            s.erase(P(a[j],j));
            a[j]/=2;
            s.insert(P(a[j],j));
        }
        m-=k;
        M=0;
        rep(j,n) M=max(M,a[j]);
        if(M<=x){
            cout << "Yes" << endl;
            return 0;
        }
    }
    
    cout << "No" << endl;

}
0