結果

問題 No.2024 Xer
ユーザー otoshigootoshigo
提出日時 2022-07-29 22:20:36
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 1,580 bytes
コンパイル時間 2,252 ms
コンパイル使用メモリ 209,032 KB
実行使用メモリ 10,984 KB
最終ジャッジ日時 2023-09-26 21:36:50
合計ジャッジ時間 5,686 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 68 ms
10,428 KB
testcase_08 AC 39 ms
10,400 KB
testcase_09 AC 72 ms
10,964 KB
testcase_10 AC 41 ms
10,328 KB
testcase_11 AC 24 ms
5,264 KB
testcase_12 AC 38 ms
6,516 KB
testcase_13 AC 42 ms
7,044 KB
testcase_14 AC 67 ms
10,940 KB
testcase_15 AC 31 ms
6,448 KB
testcase_16 AC 47 ms
9,604 KB
testcase_17 AC 29 ms
6,452 KB
testcase_18 AC 27 ms
6,192 KB
testcase_19 AC 68 ms
10,984 KB
testcase_20 AC 40 ms
6,976 KB
testcase_21 AC 71 ms
10,720 KB
testcase_22 AC 71 ms
10,616 KB
testcase_23 AC 70 ms
10,724 KB
testcase_24 AC 72 ms
10,612 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 3 ms
4,376 KB
testcase_27 AC 3 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 3 ms
4,380 KB
testcase_31 AC 3 ms
4,380 KB
testcase_32 AC 3 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 3 ms
4,376 KB
testcase_37 AC 3 ms
4,376 KB
testcase_38 AC 3 ms
4,380 KB
testcase_39 AC 2 ms
4,380 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 3 ms
4,376 KB
testcase_43 AC 2 ms
4,376 KB
testcase_44 AC 3 ms
4,376 KB
testcase_45 AC 58 ms
9,816 KB
testcase_46 AC 14 ms
4,808 KB
testcase_47 AC 43 ms
7,176 KB
testcase_48 AC 2 ms
4,376 KB
testcase_49 AC 1 ms
4,380 KB
testcase_50 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i = 0; i < n; i++)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,a,b) for (int i = a; i < b; i++)
#define rrep2(i,a,b) for (int i = a-1; i >= b; i--)
#define rep3(i,a,b,c) for (int i = a; i < b; i+=c)
#define rrep3(i,a,b,c) for (int i = a-1; i >= b; i-=c)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}

int n,x,P[200010],Q[200010];
bool flag[200010];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n>>x;
    vector<tuple<int,int,int>>vp;
    rep(i,n){
        int a;cin>>a;
        vp.push_back(make_tuple(a,0,i));
        vp.push_back(make_tuple(a^x,1,i));
    }
    sort(all(vp));
    int at=0;
    for(auto[s,t,i]:vp){
        if(flag[i])continue;
        flag[i]=true;
        if(t==0){
            if(at%2==0){
                P[at]=s;
                Q[at]=x^s;
            }
            else{
                Q[at]=s;
                P[at]=x^s;
            }
        }else{
            if(at%2==1){
                P[at]=s;
                Q[at]=x^s;
            }
            else{
                Q[at]=s;
                P[at]=x^s;
            }
        }
        at++;
    }
    rep(i,n-1){
        if(P[i]>=P[i+1]||Q[i]>=Q[i+1]){
            cout<<"No"<<"\n";
            return 0;
        }
    }
    cout<<"Yes"<<"\n";
}
0