結果

問題 No.1456 Range Xor
ユーザー boutarouboutarou
提出日時 2021-03-31 22:07:20
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 2,355 ms
コンパイル使用メモリ 209,828 KB
実行使用メモリ 11,972 KB
最終ジャッジ日時 2023-08-22 02:08:29
合計ジャッジ時間 5,623 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 50 ms
8,748 KB
testcase_04 AC 49 ms
8,500 KB
testcase_05 AC 53 ms
9,072 KB
testcase_06 AC 50 ms
8,876 KB
testcase_07 AC 77 ms
11,408 KB
testcase_08 AC 56 ms
9,292 KB
testcase_09 AC 51 ms
8,852 KB
testcase_10 AC 48 ms
8,612 KB
testcase_11 AC 14 ms
4,844 KB
testcase_12 AC 6 ms
4,380 KB
testcase_13 AC 27 ms
6,584 KB
testcase_14 AC 18 ms
5,532 KB
testcase_15 AC 41 ms
7,768 KB
testcase_16 AC 35 ms
7,272 KB
testcase_17 AC 34 ms
7,336 KB
testcase_18 AC 15 ms
4,976 KB
testcase_19 AC 29 ms
6,652 KB
testcase_20 AC 35 ms
7,184 KB
testcase_21 AC 26 ms
6,192 KB
testcase_22 AC 28 ms
6,436 KB
testcase_23 AC 19 ms
5,572 KB
testcase_24 AC 11 ms
5,004 KB
testcase_25 AC 23 ms
5,860 KB
testcase_26 AC 41 ms
7,816 KB
testcase_27 AC 32 ms
6,712 KB
testcase_28 AC 20 ms
5,716 KB
testcase_29 AC 82 ms
11,972 KB
testcase_30 AC 47 ms
8,280 KB
testcase_31 AC 18 ms
5,544 KB
testcase_32 AC 15 ms
5,260 KB
testcase_33 AC 25 ms
6,156 KB
testcase_34 AC 48 ms
8,504 KB
testcase_35 AC 23 ms
5,948 KB
testcase_36 AC 47 ms
8,596 KB
testcase_37 AC 78 ms
11,672 KB
testcase_38 AC 12 ms
4,852 KB
testcase_39 AC 34 ms
7,212 KB
testcase_40 AC 55 ms
9,304 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 8 ms
4,444 KB
testcase_43 AC 1 ms
4,380 KB
testcase_44 AC 2 ms
4,380 KB
testcase_45 AC 1 ms
4,384 KB
testcase_46 AC 2 ms
4,376 KB
testcase_47 AC 2 ms
4,380 KB
testcase_48 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < int(n); i++)
using ll = long long;
using P = pair<int, int>;

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    int n, k; cin >> n >> k;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> sum(n + 1, 0);
    rep(i, n) sum[i + 1] = sum[i] ^ a[i];
    map<int, int> mp;
    rep(i, n + 1) mp[sum[i]] = 1;
    rep(i, n + 1) {
        if (mp[sum[i] ^ k]) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}
0