結果

問題 No.1456 Range Xor
ユーザー aa
提出日時 2023-07-28 06:44:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 1,804 ms
コンパイル使用メモリ 171,784 KB
実行使用メモリ 13,120 KB
最終ジャッジ日時 2024-04-15 16:10:32
合計ジャッジ時間 6,833 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 144 ms
12,928 KB
testcase_04 AC 136 ms
12,928 KB
testcase_05 AC 131 ms
13,056 KB
testcase_06 AC 131 ms
13,056 KB
testcase_07 AC 138 ms
12,928 KB
testcase_08 AC 136 ms
13,120 KB
testcase_09 AC 138 ms
12,928 KB
testcase_10 AC 140 ms
13,056 KB
testcase_11 AC 21 ms
5,376 KB
testcase_12 AC 9 ms
5,376 KB
testcase_13 AC 37 ms
6,656 KB
testcase_14 AC 36 ms
6,656 KB
testcase_15 AC 106 ms
11,440 KB
testcase_16 AC 97 ms
10,624 KB
testcase_17 AC 49 ms
7,640 KB
testcase_18 AC 36 ms
6,400 KB
testcase_19 AC 74 ms
9,472 KB
testcase_20 AC 95 ms
10,552 KB
testcase_21 AC 71 ms
9,088 KB
testcase_22 AC 77 ms
9,360 KB
testcase_23 AC 38 ms
6,784 KB
testcase_24 AC 16 ms
5,376 KB
testcase_25 AC 32 ms
6,144 KB
testcase_26 AC 55 ms
8,320 KB
testcase_27 AC 83 ms
9,948 KB
testcase_28 AC 28 ms
6,016 KB
testcase_29 AC 116 ms
11,904 KB
testcase_30 AC 127 ms
12,416 KB
testcase_31 AC 23 ms
5,888 KB
testcase_32 AC 22 ms
5,376 KB
testcase_33 AC 43 ms
7,296 KB
testcase_34 AC 127 ms
12,288 KB
testcase_35 AC 59 ms
8,164 KB
testcase_36 AC 141 ms
12,836 KB
testcase_37 AC 118 ms
11,520 KB
testcase_38 AC 16 ms
5,376 KB
testcase_39 AC 93 ms
10,496 KB
testcase_40 AC 87 ms
10,284 KB
testcase_41 AC 3 ms
5,376 KB
testcase_42 AC 11 ms
5,376 KB
testcase_43 AC 2 ms
5,376 KB
testcase_44 AC 2 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
testcase_46 AC 1 ms
5,376 KB
testcase_47 AC 1 ms
5,376 KB
testcase_48 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    map<int, int> mp;
    mp[0]++;
    bool ok = false;
    int x = 0;
    for (int i = 0; i < N; i++) {
        x ^= A[i];
        if (mp[x ^ K] > 0) {
            ok = true;
        }
        mp[x]++;
    }
    if (ok) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}
0