結果
| 問題 | 
                            No.1456 Range Xor
                             | 
                    
| コンテスト | |
| ユーザー | 
                             🍮かんプリン
                         | 
                    
| 提出日時 | 2021-04-01 02:18:23 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 102 ms / 2,000 ms | 
| コード長 | 536 bytes | 
| コンパイル時間 | 1,572 ms | 
| コンパイル使用メモリ | 176,200 KB | 
| 実行使用メモリ | 8,192 KB | 
| 最終ジャッジ日時 | 2024-12-16 03:08:08 | 
| 合計ジャッジ時間 | 5,978 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 46 | 
ソースコード
/**
 *   @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() {
    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;
}
            
            
            
        
            
🍮かんプリン