結果

問題 No.2024 Xer
ユーザー karinohitokarinohito
提出日時 2022-07-30 00:42:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 1,966 bytes
コンパイル時間 3,050 ms
コンパイル使用メモリ 209,980 KB
実行使用メモリ 6,180 KB
最終ジャッジ日時 2023-09-27 01:11:43
合計ジャッジ時間 5,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 42 ms
6,112 KB
testcase_08 AC 30 ms
6,112 KB
testcase_09 AC 45 ms
6,128 KB
testcase_10 AC 30 ms
6,056 KB
testcase_11 AC 15 ms
4,380 KB
testcase_12 AC 25 ms
4,672 KB
testcase_13 AC 27 ms
4,940 KB
testcase_14 AC 43 ms
6,052 KB
testcase_15 AC 20 ms
4,408 KB
testcase_16 AC 30 ms
5,148 KB
testcase_17 AC 18 ms
4,376 KB
testcase_18 AC 18 ms
4,380 KB
testcase_19 AC 44 ms
5,928 KB
testcase_20 AC 27 ms
4,808 KB
testcase_21 AC 46 ms
6,180 KB
testcase_22 AC 45 ms
6,160 KB
testcase_23 AC 45 ms
6,140 KB
testcase_24 AC 46 ms
6,108 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,384 KB
testcase_32 AC 3 ms
4,380 KB
testcase_33 AC 2 ms
4,384 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,384 KB
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 3 ms
4,376 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 2 ms
4,380 KB
testcase_41 AC 2 ms
4,380 KB
testcase_42 AC 3 ms
4,376 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 2 ms
4,376 KB
testcase_45 AC 36 ms
5,572 KB
testcase_46 AC 9 ms
4,380 KB
testcase_47 AC 27 ms
4,788 KB
testcase_48 AC 1 ms
4,380 KB
testcase_49 AC 1 ms
4,380 KB
testcase_50 AC 1 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vvvvll = vector<vvvll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vvvvb = vector<vvvb>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
#define all(A) A.begin(),A.end()
#define ALL(A) A.begin(),A.end()
#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)
using pqr = priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>;

template<class T>
bool chmax(T& p, T q, bool C = 1) {
    if (C == 0 && p == q) {
        return 1;
    }
    if (p < q) {
        p = q;
        return 1;
    }
    else {
        return 0;
    }
}

template<class T>
bool chmin(T& p, T q, bool C = 1) {
    if (C == 0 && p == q) {
        return 1;
    }
    if (p > q) {
        p = q;
        return 1;
    }
    else {
        return 0;
    }
}

ll gcd(ll(a), ll(b)) {
    if (b == 0)return a;
    ll c = a;
    while (a % b != 0) {
        c = a % b;
        a = b;
        b = c;
    }
    return b;
}


vector<vector<pair<ll,pair<ll,ll>>>> G;
vll D;
vector<bool> seen;

void dfs(ll n){
    seen[n]=1;
    for(auto v:G[n]){
        if(seen[v.first])continue;
        if(v.second.second==1){
            D[v.second.first]=1;
        }
        else D[v.second.first]=0;
        dfs(v.first);
    }
    return;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);


    ll N,X;
    cin>>N>>X;
    vector<pair<ll,ll>>P(N);
    rep(i,N){
        ll A;
        cin>>A;
        P[i]={min(A,(A^X)),A};
    }
    sort(all(P));
    rep(i,N-1){
        if(P[i].second>=(P[i+1].second^X)){
            cout<<"No"<<endl;
            return 0;
        }
        if((P[i].second^X)>=(P[i+1].second)){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}
0