結果

問題 No.1456 Range Xor
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2021-04-01 02:20:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 1,561 ms
コンパイル使用メモリ 174,064 KB
実行使用メモリ 7,912 KB
最終ジャッジ日時 2023-08-22 07:39:48
合計ジャッジ時間 5,213 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 63 ms
7,752 KB
testcase_04 AC 64 ms
7,712 KB
testcase_05 AC 66 ms
7,704 KB
testcase_06 AC 63 ms
7,760 KB
testcase_07 AC 63 ms
7,756 KB
testcase_08 AC 63 ms
7,908 KB
testcase_09 AC 63 ms
7,912 KB
testcase_10 AC 63 ms
7,760 KB
testcase_11 AC 11 ms
4,376 KB
testcase_12 AC 5 ms
4,380 KB
testcase_13 AC 19 ms
4,392 KB
testcase_14 AC 19 ms
4,384 KB
testcase_15 AC 49 ms
6,268 KB
testcase_16 AC 44 ms
5,904 KB
testcase_17 AC 27 ms
5,380 KB
testcase_18 AC 18 ms
4,724 KB
testcase_19 AC 37 ms
5,584 KB
testcase_20 AC 45 ms
5,924 KB
testcase_21 AC 36 ms
5,724 KB
testcase_22 AC 38 ms
5,728 KB
testcase_23 AC 21 ms
4,408 KB
testcase_24 AC 10 ms
4,380 KB
testcase_25 AC 17 ms
4,380 KB
testcase_26 AC 29 ms
5,436 KB
testcase_27 AC 41 ms
5,936 KB
testcase_28 AC 15 ms
4,380 KB
testcase_29 AC 58 ms
7,896 KB
testcase_30 AC 60 ms
7,748 KB
testcase_31 AC 14 ms
4,380 KB
testcase_32 AC 11 ms
4,376 KB
testcase_33 AC 23 ms
4,588 KB
testcase_34 AC 59 ms
7,756 KB
testcase_35 AC 30 ms
5,388 KB
testcase_36 AC 61 ms
7,760 KB
testcase_37 AC 51 ms
6,588 KB
testcase_38 AC 10 ms
4,380 KB
testcase_39 AC 43 ms
5,924 KB
testcase_40 AC 42 ms
6,060 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 7 ms
4,384 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 2 ms
4,380 KB
testcase_45 AC 2 ms
4,380 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 #

/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2021.04.01 02:18:14
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    unordered_map<int,int> mp;
    mp[0]++;
    int n,k;cin >> n >> k;
    int x = 0;
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        int a;cin >> a;
        x ^= a;
        if (mp.find(x^k) != mp.end()) {
            ans += mp[x^k];
        }
        mp[x]++;
    }
    if (ans >= 1) {
        puts("Yes");
    }
    else {
        puts("No");
    }
    return 0;
}
0