結果
| 問題 | 
                            No.1456 Range Xor
                             | 
                    
| コンテスト | |
| ユーザー | 
                             DaYuanChi
                         | 
                    
| 提出日時 | 2021-04-03 21:15:38 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 458 bytes | 
| コンパイル時間 | 2,157 ms | 
| コンパイル使用メモリ | 173,388 KB | 
| 実行使用メモリ | 8,832 KB | 
| 最終ジャッジ日時 | 2024-12-25 16:02:38 | 
| 合計ジャッジ時間 | 6,067 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 44 WA * 2 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
  int n; cin >> n;
  ll k; cin >> k;
  vector<ll> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];
  set<ll> st;
  ll now = k;
  for(int i = 0; i < n; i++){
    now ^= a[i];
    st.insert(now);
  }
  ll now2 = 0;
  for(int i = 0; i < n; i++){
    now2 ^= a[i];
    if(st.count(now2)){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
            
            
            
        
            
DaYuanChi