結果

問題 No.1456 Range Xor
ユーザー kpinkcatkpinkcat
提出日時 2023-09-05 16:16:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 2,148 ms
コンパイル使用メモリ 204,980 KB
実行使用メモリ 7,624 KB
最終ジャッジ日時 2023-09-05 16:16:25
合計ジャッジ時間 5,839 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 42 ms
4,380 KB
testcase_04 AC 46 ms
4,420 KB
testcase_05 AC 64 ms
6,180 KB
testcase_06 AC 43 ms
4,380 KB
testcase_07 AC 74 ms
6,868 KB
testcase_08 AC 59 ms
5,724 KB
testcase_09 AC 43 ms
4,376 KB
testcase_10 AC 50 ms
4,944 KB
testcase_11 AC 14 ms
4,380 KB
testcase_12 AC 7 ms
4,376 KB
testcase_13 AC 25 ms
5,008 KB
testcase_14 AC 17 ms
4,380 KB
testcase_15 AC 34 ms
4,376 KB
testcase_16 AC 42 ms
4,984 KB
testcase_17 AC 35 ms
5,348 KB
testcase_18 AC 15 ms
4,380 KB
testcase_19 AC 42 ms
5,416 KB
testcase_20 AC 44 ms
5,216 KB
testcase_21 AC 32 ms
4,580 KB
testcase_22 AC 28 ms
4,380 KB
testcase_23 AC 25 ms
4,772 KB
testcase_24 AC 12 ms
4,376 KB
testcase_25 AC 22 ms
4,856 KB
testcase_26 AC 40 ms
5,588 KB
testcase_27 AC 39 ms
4,908 KB
testcase_28 AC 19 ms
4,608 KB
testcase_29 AC 81 ms
7,624 KB
testcase_30 AC 51 ms
5,216 KB
testcase_31 AC 18 ms
4,520 KB
testcase_32 AC 15 ms
4,376 KB
testcase_33 AC 26 ms
4,724 KB
testcase_34 AC 58 ms
5,744 KB
testcase_35 AC 34 ms
4,980 KB
testcase_36 AC 52 ms
5,116 KB
testcase_37 AC 78 ms
7,552 KB
testcase_38 AC 12 ms
4,376 KB
testcase_39 AC 34 ms
4,376 KB
testcase_40 AC 55 ms
6,212 KB
testcase_41 AC 3 ms
4,376 KB
testcase_42 AC 8 ms
4,380 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 1 ms
4,380 KB
testcase_45 AC 2 ms
4,376 KB
testcase_46 AC 2 ms
4,376 KB
testcase_47 AC 1 ms
4,380 KB
testcase_48 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using namespace std;

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