結果

問題 No.1456 Range Xor
ユーザー DaYuanChi
提出日時 2021-04-03 21:14:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 1,770 ms
コンパイル使用メモリ 173,396 KB
実行使用メモリ 8,832 KB
最終ジャッジ日時 2024-12-25 16:01:24
合計ジャッジ時間 5,535 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0