結果

問題 No.2024 Xer
ユーザー chocoruskchocorusk
提出日時 2022-08-09 02:11:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 1,227 bytes
コンパイル時間 3,886 ms
コンパイル使用メモリ 196,796 KB
実行使用メモリ 13,904 KB
最終ジャッジ日時 2023-10-19 13:34:25
合計ジャッジ時間 8,817 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 229 ms
13,904 KB
testcase_08 AC 136 ms
13,904 KB
testcase_09 AC 112 ms
5,232 KB
testcase_10 AC 139 ms
13,904 KB
testcase_11 AC 59 ms
6,952 KB
testcase_12 AC 116 ms
9,228 KB
testcase_13 AC 129 ms
9,836 KB
testcase_14 AC 241 ms
13,484 KB
testcase_15 AC 83 ms
8,040 KB
testcase_16 AC 149 ms
10,468 KB
testcase_17 AC 61 ms
7,548 KB
testcase_18 AC 70 ms
7,484 KB
testcase_19 AC 231 ms
13,432 KB
testcase_20 AC 99 ms
9,520 KB
testcase_21 AC 204 ms
13,732 KB
testcase_22 AC 203 ms
13,812 KB
testcase_23 AC 218 ms
13,788 KB
testcase_24 AC 206 ms
13,616 KB
testcase_25 AC 3 ms
4,348 KB
testcase_26 AC 4 ms
4,348 KB
testcase_27 AC 4 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 3 ms
4,348 KB
testcase_30 AC 4 ms
4,348 KB
testcase_31 AC 5 ms
4,348 KB
testcase_32 AC 5 ms
4,348 KB
testcase_33 AC 4 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 4 ms
4,348 KB
testcase_37 AC 5 ms
4,348 KB
testcase_38 AC 6 ms
4,348 KB
testcase_39 AC 2 ms
4,348 KB
testcase_40 AC 2 ms
4,348 KB
testcase_41 AC 3 ms
4,348 KB
testcase_42 AC 4 ms
4,348 KB
testcase_43 AC 4 ms
4,348 KB
testcase_44 AC 5 ms
4,348 KB
testcase_45 AC 65 ms
4,348 KB
testcase_46 AC 17 ms
4,348 KB
testcase_47 AC 50 ms
4,348 KB
testcase_48 AC 2 ms
4,348 KB
testcase_49 AC 2 ms
4,348 KB
testcase_50 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
using mint=modint998244353;
int a[200020];
int main()
{
    int n, x;
    cin>>n>>x;
    map<int, int> mp;
    for(int i=0; i<n; i++) cin>>a[i];
    auto f=[&](int v)->int{
        return (x^((1<<30)-1))&v;
    };
    for(int i=0; i<n; i++){
        mp[f(a[i])]++;
    }
    for(auto p:mp){
        if(p.second!=1){
            cout<<"No"<<endl;
            return 0;
        }
    }
    sort(a, a+n, [&](int u, int v){ return f(u)<f(v);});
    for(int i=0; i<n-1; i++){
        if(a[i]>=(a[i+1]^x) || (a[i]^x)>=a[i+1]){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}
0