結果

問題 No.1456 Range Xor
ユーザー KKT89KKT89
提出日時 2021-08-03 05:11:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 775 bytes
コンパイル時間 2,452 ms
コンパイル使用メモリ 215,484 KB
実行使用メモリ 8,716 KB
最終ジャッジ日時 2023-10-14 21:03:26
合計ジャッジ時間 6,888 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,356 KB
testcase_03 AC 64 ms
8,596 KB
testcase_04 AC 63 ms
8,520 KB
testcase_05 AC 63 ms
8,496 KB
testcase_06 AC 63 ms
8,588 KB
testcase_07 AC 63 ms
8,616 KB
testcase_08 AC 64 ms
8,628 KB
testcase_09 AC 63 ms
8,484 KB
testcase_10 AC 64 ms
8,716 KB
testcase_11 AC 10 ms
4,476 KB
testcase_12 AC 4 ms
4,352 KB
testcase_13 AC 18 ms
5,100 KB
testcase_14 AC 18 ms
5,108 KB
testcase_15 AC 50 ms
7,496 KB
testcase_16 AC 46 ms
7,244 KB
testcase_17 AC 23 ms
5,396 KB
testcase_18 AC 17 ms
4,944 KB
testcase_19 AC 36 ms
6,412 KB
testcase_20 AC 45 ms
7,164 KB
testcase_21 AC 35 ms
6,280 KB
testcase_22 AC 37 ms
6,520 KB
testcase_23 AC 19 ms
4,972 KB
testcase_24 AC 8 ms
4,348 KB
testcase_25 AC 15 ms
4,868 KB
testcase_26 AC 27 ms
5,716 KB
testcase_27 AC 41 ms
6,804 KB
testcase_28 AC 13 ms
4,808 KB
testcase_29 AC 56 ms
7,728 KB
testcase_30 AC 60 ms
8,256 KB
testcase_31 AC 12 ms
4,700 KB
testcase_32 AC 10 ms
4,412 KB
testcase_33 AC 21 ms
5,232 KB
testcase_34 AC 59 ms
8,116 KB
testcase_35 AC 29 ms
5,728 KB
testcase_36 AC 61 ms
8,268 KB
testcase_37 AC 53 ms
7,860 KB
testcase_38 AC 8 ms
4,352 KB
testcase_39 AC 44 ms
7,088 KB
testcase_40 AC 43 ms
7,036 KB
testcase_41 AC 3 ms
4,348 KB
testcase_42 AC 6 ms
4,352 KB
testcase_43 AC 2 ms
4,348 KB
testcase_44 AC 1 ms
4,356 KB
testcase_45 AC 2 ms
4,352 KB
testcase_46 AC 2 ms
4,348 KB
testcase_47 AC 2 ms
4,352 KB
testcase_48 AC 1 ms
4,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,k; cin >> n >> k;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    vector<int> b(n+1);
    for(int i=0;i<n;i++){
        b[i+1]=b[i]^a[i];
    }
    set<int> st;
    bool ok=false;
    for(int i=0;i<n;i++){
        st.insert(b[i]);
        int u=(k^b[i+1]);
        if(st.find(u)!=st.end()){
            ok=true;
        }
    }
    if(ok){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
}
0