結果

問題 No.1456 Range Xor
ユーザー MZKiMZKi
提出日時 2021-03-31 21:43:48
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 902 bytes
コンパイル時間 1,441 ms
コンパイル使用メモリ 155,428 KB
実行使用メモリ 16,380 KB
最終ジャッジ日時 2023-08-22 00:27:06
合計ジャッジ時間 7,407 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 146 ms
16,380 KB
testcase_04 AC 142 ms
16,196 KB
testcase_05 AC 140 ms
16,304 KB
testcase_06 AC 152 ms
16,252 KB
testcase_07 AC 162 ms
16,188 KB
testcase_08 AC 140 ms
16,188 KB
testcase_09 AC 135 ms
16,228 KB
testcase_10 AC 133 ms
16,304 KB
testcase_11 AC 18 ms
5,620 KB
testcase_12 AC 8 ms
4,672 KB
testcase_13 AC 34 ms
7,264 KB
testcase_14 AC 34 ms
7,228 KB
testcase_15 AC 113 ms
13,936 KB
testcase_16 AC 104 ms
13,196 KB
testcase_17 AC 50 ms
8,780 KB
testcase_18 AC 33 ms
7,264 KB
testcase_19 AC 79 ms
10,972 KB
testcase_20 AC 103 ms
13,360 KB
testcase_21 AC 76 ms
11,016 KB
testcase_22 AC 82 ms
11,280 KB
testcase_23 AC 39 ms
7,592 KB
testcase_24 AC 16 ms
5,216 KB
testcase_25 AC 29 ms
6,788 KB
testcase_26 AC 56 ms
9,376 KB
testcase_27 AC 91 ms
12,072 KB
testcase_28 AC 25 ms
6,332 KB
testcase_29 AC 122 ms
14,864 KB
testcase_30 AC 134 ms
15,988 KB
testcase_31 AC 23 ms
6,060 KB
testcase_32 AC 21 ms
5,856 KB
testcase_33 AC 43 ms
8,120 KB
testcase_34 AC 135 ms
15,580 KB
testcase_35 AC 60 ms
9,640 KB
testcase_36 AC 145 ms
16,248 KB
testcase_37 AC 124 ms
14,344 KB
testcase_38 AC 17 ms
5,380 KB
testcase_39 AC 97 ms
12,540 KB
testcase_40 AC 95 ms
12,220 KB
testcase_41 AC 3 ms
4,384 KB
testcase_42 AC 11 ms
4,720 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 2 ms
4,380 KB
testcase_45 AC 2 ms
4,384 KB
testcase_46 AC 1 ms
4,380 KB
testcase_47 AC 1 ms
4,380 KB
testcase_48 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define eps (double)(1e-9)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    rep(i, n)cin >> a[i];
    map<ll, ll> mp;
    bool ok = false;
    ll sum = 0;
    mp[0]++;
    rep(i, n){
        sum ^= a[i];
        mp[sum]++;
        if(mp[sum^k])ok = true;
    }
    cout << (ok ? "Yes" : "No") << endl;
}
0