結果

問題 No.1456 Range Xor
ユーザー DaYuanChiDaYuanChi
提出日時 2021-04-03 21:18:16
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 2,015 ms
コンパイル使用メモリ 172,868 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-08-26 17:05:19
合計ジャッジ時間 6,305 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 80 ms
8,696 KB
testcase_04 AC 78 ms
8,628 KB
testcase_05 AC 82 ms
8,660 KB
testcase_06 AC 80 ms
8,632 KB
testcase_07 AC 97 ms
8,640 KB
testcase_08 AC 83 ms
8,704 KB
testcase_09 AC 78 ms
8,576 KB
testcase_10 AC 75 ms
8,560 KB
testcase_11 AC 14 ms
4,380 KB
testcase_12 AC 7 ms
4,376 KB
testcase_13 AC 27 ms
4,820 KB
testcase_14 AC 23 ms
4,876 KB
testcase_15 AC 62 ms
7,512 KB
testcase_16 AC 54 ms
7,276 KB
testcase_17 AC 38 ms
5,532 KB
testcase_18 AC 21 ms
4,716 KB
testcase_19 AC 43 ms
6,584 KB
testcase_20 AC 54 ms
7,072 KB
testcase_21 AC 42 ms
6,196 KB
testcase_22 AC 44 ms
6,592 KB
testcase_23 AC 26 ms
5,016 KB
testcase_24 AC 12 ms
4,388 KB
testcase_25 AC 23 ms
4,728 KB
testcase_26 AC 42 ms
5,616 KB
testcase_27 AC 48 ms
6,716 KB
testcase_28 AC 20 ms
4,536 KB
testcase_29 AC 97 ms
7,772 KB
testcase_30 AC 72 ms
8,380 KB
testcase_31 AC 18 ms
4,376 KB
testcase_32 AC 15 ms
4,380 KB
testcase_33 AC 29 ms
5,152 KB
testcase_34 AC 73 ms
7,996 KB
testcase_35 AC 35 ms
5,924 KB
testcase_36 AC 76 ms
8,440 KB
testcase_37 AC 87 ms
7,768 KB
testcase_38 AC 12 ms
4,380 KB
testcase_39 AC 53 ms
7,108 KB
testcase_40 AC 64 ms
6,932 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 2 ms
4,380 KB
testcase_45 AC 2 ms
4,380 KB
testcase_46 AC 1 ms
4,376 KB
testcase_47 AC 2 ms
4,376 KB
testcase_48 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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;
  st.insert(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