結果

問題 No.1456 Range Xor
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2021-04-01 02:20:10
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 174,464 KB
実行使用メモリ 8,076 KB
最終ジャッジ日時 2024-12-16 03:13:06
合計ジャッジ時間 4,840 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

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