結果

問題 No.2056 非力なレッド
ユーザー namakoiscatnamakoiscat
提出日時 2022-08-26 21:43:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 5,376 bytes
コンパイル時間 2,721 ms
コンパイル使用メモリ 211,788 KB
実行使用メモリ 12,772 KB
最終ジャッジ日時 2024-04-21 23:46:00
合計ジャッジ時間 4,819 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
9,728 KB
testcase_01 AC 4 ms
9,600 KB
testcase_02 AC 5 ms
9,728 KB
testcase_03 AC 5 ms
9,728 KB
testcase_04 AC 5 ms
9,600 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 4 ms
9,728 KB
testcase_10 AC 4 ms
9,728 KB
testcase_11 AC 5 ms
9,600 KB
testcase_12 WA -
testcase_13 AC 23 ms
11,392 KB
testcase_14 WA -
testcase_15 AC 23 ms
11,392 KB
testcase_16 AC 6 ms
9,856 KB
testcase_17 WA -
testcase_18 AC 5 ms
9,856 KB
testcase_19 AC 7 ms
9,984 KB
testcase_20 AC 25 ms
11,648 KB
testcase_21 AC 10 ms
9,856 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 13 ms
10,240 KB
testcase_25 AC 27 ms
11,904 KB
testcase_26 AC 28 ms
12,032 KB
testcase_27 AC 26 ms
11,904 KB
testcase_28 AC 32 ms
12,544 KB
testcase_29 AC 31 ms
12,544 KB
testcase_30 AC 33 ms
12,544 KB
testcase_31 AC 31 ms
12,544 KB
testcase_32 AC 32 ms
12,544 KB
testcase_33 AC 33 ms
12,544 KB
testcase_34 WA -
testcase_35 AC 32 ms
12,544 KB
testcase_36 AC 31 ms
12,544 KB
testcase_37 WA -
testcase_38 AC 5 ms
9,728 KB
testcase_39 AC 5 ms
9,472 KB
testcase_40 AC 5 ms
9,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// __builtin_popcount() ;
// multiset ;
// unordered_set ;
// reverse ;

#include <bits/stdc++.h>
using namespace std;
// #include<boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;

typedef long long ll;
typedef string st ;
typedef long double ld ;
typedef unsigned long long ull ;
const ll mod0 = 1000000007;
const ll mod1 = 998244353 ;
const ll LINF =  1000000000000000000 ;  //(10^18)
const int INF = 1000000000 ;            // (10^9)
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            x.begin(), x.end()
#define rep(i,a,n)        for (ll i = a; i <= (n); ++i)
#define re                return 0;
#define fore(i,a)         for(auto &i:a)
#define V                 vector
const ld pai = acos(-1) ;
using P = pair<ll,ll> ;
using Edge = tuple<ll,ll,ll> ;
using AAA  = tuple<ll,ll,ll,ll> ;
#define  C            cout   
#define  E            "\n";

// テンプレ文字列
st zz = "abcdefghijklmnopqrstuvwxyz" ;
st ZZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
st tintin = "%" ;
st Y = "Yes" ; 
st YY = "No" ;
st at = "atcoder" ;
st KU = " " ;

void chmin(ll& x ,ll y){x = min(x,y) ;}
void chmax(ll& x ,ll y){x = max(x,y) ;}


vector<ll> Y4 = {0,1,0,-1} ;
vector<ll> X4 = {1,0,-1,0} ;

vector<ll> Y8 = {0,1,1,1,0,-1,-1,-1} ;
vector<ll> X8 = {1,1,0,-1,-1,-1,0,1} ;

 
ll gcd(ll a, ll b){
 
   if(b == 0){
    return a;
}
return gcd(b,a%b) ;
}
 
 
ll lcm(ll a, ll b){
    
    ll ans = a*b /gcd(a,b) ;
    return ans ;
}
 
// true --→ 素数 、false --→ 素数じゃない
bool nis(ll a){
    bool flag = true ;
    rep(i,2,sqrt(a)+1){
        if(a%i == 0){
          flag = false ;
          break ;
}
}
 return flag ;   
}

 ll jun(ll a,ll b, ll c,ll rank ){
     
    vector<ll> ANS ;
    ANS.pb(-LINF) ;
    ANS.pb(a) ;
    ANS.pb(b) ;
    ANS.pb(c) ;
    
    sort(all(ANS)) ;
    return ANS[rank] ;
}


//  UF.initはいっかいだけならいいけど、二回目以降はrepで初期化
vector<ll> par;
class UnionFind {
public:
 
  
   
  // サイズをGET!
  void init(ll sz) {
       par.resize(sz,-1);
}
   // 各連結成分の一番上を返す
  ll root(ll x) {
    if (par[x] < 0) return x;
    return par[x] = root(par[x]);
  }
   
  // 結合作業
  bool unite(ll x, ll y) {
    x = root(x); y = root(y);
    if (x == y) return false;
    if (par[x] > par[y]) swap(x,y);
    par[x] += par[y];
    par[y] = x;
    return true;
  }
  // 同じグループか判定
  bool same(ll x, ll y) { return root(x) == root(y);}
  // グループのサイズをGET!
  ll size(ll x) { return -par[root(x)];}
};
 
UnionFind UF ;


vector<ll> enumdiv(ll n) { 
    vector<ll> S;
    for (ll i = 1; i*i <= n; i++) if (n%i == 0) { S.pb(i); if (i*i != n) S.pb(n / i); }
    sort(S.begin(), S.end());
    return S;
}
 
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> using max_priority_queue = priority_queue<T, vector<T>, less<T>> ;
// 使用例 min_priority_queue<ll (ここは型)> Q ;


vector<pair<long long, long long>> prime_factorize(long long N){
    vector<pair<long long, long long>> res;
    for(long long a = 2; a * a <= N; ++a){
        if(N % a != 0) continue;
        long long ex = 0;
        while(N % a == 0) ++ex, N /= a;
        res.push_back({a,ex});
    }
    if(N != 1) res.push_back({N,1});
    return res;
}

ll dist[1 << 18] ;
vector<ll> GG[1 << 18] ;

void bfs(ll N ,ll a){
     queue<ll> Q ;
     Q.push(a) ;
     
     rep(i,0,N){
        dist[i] = -1 ;         
     }
     dist[a] = 0 ;
     while(!Q.empty()){
         ll pos = Q.front() ;
         Q.pop() ;
         
         fore(u,GG[pos]){
             if(dist[u] == -1){
                 dist[u] = dist[pos] + 1 ;
                 Q.push(u) ;
             }
         }
     }
}


ll binpower(ll a, ll b,ll c) {
	ll ans = 1;
	while (b != 0) {
		if (b % 2 == 1) {
			ans = (ans)*a % c;
		}
		a = a*a % c;
		b /= 2;
	}
	return ans;
}

// ll dp[][][] ;
// ll dp[][][][] ;

int main(void){ 
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

  
// nis(ll a) 素数判定  素数ならtrue
// jun(ll a,ll b,ll c, ll d) 三つのなかのd番目
// gcd(ll a , ll b) gcd 
// lcm(ll a ,ll b ) lcd 
// UF  UF.init(ll N) ; UF.root(i) ; UF.unite(a,b) ; UF.same(a,b) ; UF.size(i) ;
// enumdiv(ll a )約数列挙
// prime_factorize(ll p) aのb乗のかたちででてくる 配列で受け取る
// bfs(ll N , ll a ) N = 頂点数 , a = 始点 
// binpower(a,b,c) aのb条 をcでわったやつをO(logb) ぐらいでだしてくれるやつ
// mod0 --→ 1000000007  mod1 --→ 998244353 


ll N,X,M ;
cin>>N>>X>>M ;

V<ll> A(N+1) ;
rep(i,1,N){
    cin>>A[i] ;
}
V<bool> B(N+1) ;
V<ll> CC(N+1) ;

ll ma = -1 ;
rep(i,1,N){
    
    if(X <= A[i]){
        B[i] = true ;
        ma = i ;
        while(1){
            if(X > A[i])break ;
            A[i] /= 2 ;
            CC[i] ++ ;
        }
    }
    
}

ll p = min(N,M) ;

if(ma > p){
    C << YY << E
    re
}

ll ans = -1 ;
rep(i,1,N){
     ans = max(ans,CC[i]) ;
}

if(ans <= p){
    C << Y << E
}else{
    C << YY << E
}



 // if(dx < 0 || dy < 0 || dx >= W || dy >= H) continue ;
 // ld p  = sqrt(abs((A[i] - A[j])*(A[i] - A[j])) + abs((B[i] - B[j])*(B[i] - B[j]))) ;
 // C << fixed << setprecision(10) << 
re
}
0