結果

問題 No.1456 Range Xor
ユーザー HaaHaa
提出日時 2021-03-31 21:55:00
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 1,999 ms
コンパイル使用メモリ 172,116 KB
実行使用メモリ 9,668 KB
最終ジャッジ日時 2023-08-22 01:28:48
合計ジャッジ時間 5,752 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 78 ms
9,508 KB
testcase_04 AC 74 ms
9,504 KB
testcase_05 AC 77 ms
9,324 KB
testcase_06 AC 76 ms
9,304 KB
testcase_07 AC 93 ms
9,668 KB
testcase_08 AC 80 ms
9,324 KB
testcase_09 AC 76 ms
9,300 KB
testcase_10 AC 74 ms
9,464 KB
testcase_11 AC 15 ms
4,376 KB
testcase_12 AC 7 ms
4,376 KB
testcase_13 AC 27 ms
4,904 KB
testcase_14 AC 23 ms
4,956 KB
testcase_15 AC 60 ms
8,068 KB
testcase_16 AC 54 ms
7,788 KB
testcase_17 AC 37 ms
5,696 KB
testcase_18 AC 21 ms
4,892 KB
testcase_19 AC 44 ms
6,804 KB
testcase_20 AC 53 ms
7,764 KB
testcase_21 AC 40 ms
6,740 KB
testcase_22 AC 44 ms
6,932 KB
testcase_23 AC 26 ms
5,420 KB
testcase_24 AC 12 ms
4,376 KB
testcase_25 AC 23 ms
4,620 KB
testcase_26 AC 42 ms
5,968 KB
testcase_27 AC 49 ms
7,352 KB
testcase_28 AC 20 ms
4,864 KB
testcase_29 AC 90 ms
8,596 KB
testcase_30 AC 70 ms
8,828 KB
testcase_31 AC 18 ms
4,496 KB
testcase_32 AC 16 ms
4,380 KB
testcase_33 AC 29 ms
5,344 KB
testcase_34 AC 71 ms
8,776 KB
testcase_35 AC 35 ms
6,236 KB
testcase_36 AC 74 ms
9,088 KB
testcase_37 AC 86 ms
8,304 KB
testcase_38 AC 13 ms
4,380 KB
testcase_39 AC 52 ms
7,520 KB
testcase_40 AC 63 ms
7,592 KB
testcase_41 AC 3 ms
4,376 KB
testcase_42 AC 9 ms
4,380 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 2 ms
4,380 KB
testcase_45 AC 2 ms
4,380 KB
testcase_46 AC 1 ms
4,376 KB
testcase_47 AC 1 ms
4,380 KB
testcase_48 AC 2 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=1000000007;
constexpr ll INF=2e18;

int main(){
    int n, k; cin >> n >> k;
    VI a(n); REP(i,n) cin >> a[i];
    VI s(n+1); s[0]=0;
    REP(i,n) s[i+1]=s[i]^a[i];
    set<int> st;
    REP(i,n+1) st.insert(s[i]);
    REP(i,n+1){
        if(st.count(s[i]^k)){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}
0