結果

問題 No.1456 Range Xor
ユーザー ooooobaoooooba
提出日時 2021-09-05 23:02:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 745 bytes
コンパイル時間 1,072 ms
コンパイル使用メモリ 123,952 KB
実行使用メモリ 8,024 KB
最終ジャッジ日時 2023-08-24 05:30:32
合計ジャッジ時間 5,276 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 39 ms
4,380 KB
testcase_04 AC 42 ms
4,588 KB
testcase_05 AC 49 ms
5,900 KB
testcase_06 AC 39 ms
4,376 KB
testcase_07 AC 53 ms
6,408 KB
testcase_08 AC 47 ms
5,808 KB
testcase_09 AC 40 ms
4,376 KB
testcase_10 AC 43 ms
5,016 KB
testcase_11 AC 12 ms
4,380 KB
testcase_12 AC 6 ms
4,380 KB
testcase_13 AC 19 ms
4,764 KB
testcase_14 AC 16 ms
4,380 KB
testcase_15 AC 32 ms
4,376 KB
testcase_16 AC 34 ms
4,652 KB
testcase_17 AC 26 ms
5,568 KB
testcase_18 AC 14 ms
4,380 KB
testcase_19 AC 33 ms
5,708 KB
testcase_20 AC 35 ms
5,184 KB
testcase_21 AC 27 ms
4,568 KB
testcase_22 AC 26 ms
4,376 KB
testcase_23 AC 19 ms
4,376 KB
testcase_24 AC 9 ms
4,380 KB
testcase_25 AC 17 ms
4,380 KB
testcase_26 AC 29 ms
5,532 KB
testcase_27 AC 32 ms
4,612 KB
testcase_28 AC 15 ms
4,376 KB
testcase_29 AC 54 ms
8,024 KB
testcase_30 AC 42 ms
4,760 KB
testcase_31 AC 14 ms
4,380 KB
testcase_32 AC 12 ms
4,376 KB
testcase_33 AC 20 ms
4,452 KB
testcase_34 AC 45 ms
5,956 KB
testcase_35 AC 25 ms
4,696 KB
testcase_36 AC 43 ms
4,828 KB
testcase_37 AC 50 ms
6,808 KB
testcase_38 AC 9 ms
4,376 KB
testcase_39 AC 30 ms
4,380 KB
testcase_40 AC 39 ms
5,940 KB
testcase_41 AC 3 ms
4,376 KB
testcase_42 AC 7 ms
4,376 KB
testcase_43 WA -
testcase_44 AC 1 ms
4,376 KB
testcase_45 WA -
testcase_46 AC 1 ms
4,376 KB
testcase_47 WA -
testcase_48 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std; // NOLINT

int main() {
    int32_t n;
    uint32_t k;
    cin >> n >> k;
    vector<uint32_t> as(n);
    for (auto &&a : as) {
        cin >> a;
    }
    uint32_t s = 0;
    unordered_set<uint32_t> st;
    for (auto i = 0; i < n; ++i) {
        s ^= as[i];
        if (st.find(s ^ k) != st.end()) {
            cout << "Yes" << endl;
            return 0;
        }
        st.insert(s);
    }
    cout << "No" << endl;
    return 0;
}
0