結果

問題 No.1456 Range Xor
ユーザー SSRSSSRS
提出日時 2021-03-31 21:18:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 1,774 ms
コンパイル使用メモリ 173,384 KB
実行使用メモリ 8,832 KB
最終ジャッジ日時 2024-05-09 04:40:28
合計ジャッジ時間 5,686 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 100 ms
8,704 KB
testcase_04 AC 100 ms
8,704 KB
testcase_05 AC 100 ms
8,704 KB
testcase_06 AC 96 ms
8,704 KB
testcase_07 AC 99 ms
8,704 KB
testcase_08 AC 97 ms
8,832 KB
testcase_09 AC 97 ms
8,704 KB
testcase_10 AC 101 ms
8,704 KB
testcase_11 AC 15 ms
6,940 KB
testcase_12 AC 7 ms
6,944 KB
testcase_13 AC 28 ms
6,940 KB
testcase_14 AC 27 ms
6,944 KB
testcase_15 AC 77 ms
7,680 KB
testcase_16 AC 70 ms
7,296 KB
testcase_17 AC 38 ms
6,940 KB
testcase_18 AC 27 ms
6,940 KB
testcase_19 AC 55 ms
6,940 KB
testcase_20 AC 70 ms
7,296 KB
testcase_21 AC 53 ms
6,944 KB
testcase_22 AC 56 ms
6,940 KB
testcase_23 AC 29 ms
6,944 KB
testcase_24 AC 13 ms
6,944 KB
testcase_25 AC 24 ms
6,944 KB
testcase_26 AC 42 ms
6,940 KB
testcase_27 AC 61 ms
6,940 KB
testcase_28 AC 21 ms
6,940 KB
testcase_29 AC 83 ms
8,064 KB
testcase_30 AC 91 ms
8,448 KB
testcase_31 AC 20 ms
6,944 KB
testcase_32 AC 16 ms
6,940 KB
testcase_33 AC 32 ms
6,944 KB
testcase_34 AC 91 ms
8,320 KB
testcase_35 AC 43 ms
6,944 KB
testcase_36 AC 95 ms
8,704 KB
testcase_37 AC 80 ms
7,808 KB
testcase_38 AC 14 ms
6,940 KB
testcase_39 AC 67 ms
7,168 KB
testcase_40 AC 64 ms
7,040 KB
testcase_41 AC 3 ms
6,940 KB
testcase_42 AC 9 ms
6,944 KB
testcase_43 WA -
testcase_44 AC 2 ms
6,944 KB
testcase_45 WA -
testcase_46 AC 2 ms
6,944 KB
testcase_47 WA -
testcase_48 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, K;
  cin >> N >> K;
  vector<int> A(N);
  for (int i = 0; i < N; i++){
    cin >> A[i];
  }
  vector<int> X(N + 1);
  X[0] = 0;
  for (int i = 0; i < N; i++){
    X[i + 1] = X[i] ^ A[i];
  }
  bool ok = false;
  set<int> st;
  for (int i = 0; i < N; i++){
    if (st.count(X[i] ^ K)){
      ok = true;
    }
    st.insert(X[i]);
  }
  if (ok){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
0