結果

問題 No.1456 Range Xor
ユーザー SSRSSSRS
提出日時 2021-03-31 21:19:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 1,974 ms
コンパイル使用メモリ 172,008 KB
実行使用メモリ 8,684 KB
最終ジャッジ日時 2023-08-21 22:30:02
合計ジャッジ時間 6,329 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 94 ms
8,592 KB
testcase_04 AC 92 ms
8,516 KB
testcase_05 AC 91 ms
8,588 KB
testcase_06 AC 91 ms
8,600 KB
testcase_07 AC 93 ms
8,624 KB
testcase_08 AC 93 ms
8,560 KB
testcase_09 AC 96 ms
8,684 KB
testcase_10 AC 94 ms
8,564 KB
testcase_11 AC 15 ms
4,524 KB
testcase_12 AC 7 ms
4,376 KB
testcase_13 AC 26 ms
5,060 KB
testcase_14 AC 26 ms
5,072 KB
testcase_15 AC 73 ms
7,680 KB
testcase_16 AC 65 ms
7,268 KB
testcase_17 AC 35 ms
5,432 KB
testcase_18 AC 24 ms
4,968 KB
testcase_19 AC 53 ms
6,524 KB
testcase_20 AC 65 ms
7,512 KB
testcase_21 AC 50 ms
6,232 KB
testcase_22 AC 52 ms
6,432 KB
testcase_23 AC 28 ms
4,952 KB
testcase_24 AC 12 ms
4,384 KB
testcase_25 AC 22 ms
5,060 KB
testcase_26 AC 39 ms
5,608 KB
testcase_27 AC 59 ms
6,740 KB
testcase_28 AC 19 ms
4,656 KB
testcase_29 AC 81 ms
7,884 KB
testcase_30 AC 90 ms
8,284 KB
testcase_31 AC 18 ms
4,748 KB
testcase_32 AC 15 ms
4,432 KB
testcase_33 AC 31 ms
5,152 KB
testcase_34 AC 87 ms
8,156 KB
testcase_35 AC 41 ms
5,656 KB
testcase_36 AC 89 ms
8,360 KB
testcase_37 AC 76 ms
7,756 KB
testcase_38 AC 12 ms
4,380 KB
testcase_39 AC 63 ms
7,076 KB
testcase_40 AC 62 ms
7,236 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 9 ms
4,380 KB
testcase_43 AC 1 ms
4,380 KB
testcase_44 AC 1 ms
4,380 KB
testcase_45 AC 1 ms
4,376 KB
testcase_46 AC 1 ms
4,384 KB
testcase_47 AC 1 ms
4,376 KB
testcase_48 AC 2 ms
4,380 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