-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB_AGAGA_XOOORRR.cpp
More file actions
46 lines (39 loc) · 837 Bytes
/
B_AGAGA_XOOORRR.cpp
File metadata and controls
46 lines (39 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <bits/stdc++.h>
using namespace std;
#define int long long
inline void n_lamba_29() {
int n;
cin >> n;
vector<int> pre(n), v(n);
for(int i=0;i<n;i++) {
cin >> v[i];
}
pre[0] = v[0];
for(int i=1;i<n;i++) pre[i] = pre[i-1] ^ v[i];
if(pre[n-1] == 0) {
cout << "YES\n";
return;
}
for(int i=0;i<n;i++) {
for(int j=i+1;j<n-1;j++) {
int ff = pre[i];
int ss = pre[j] ^ pre[i];
int tt = pre[n-1] ^ pre[j];
if(ff == ss && ff == tt) {
cout << "YES\n";
return;
}
}
}
cout << "NO\n";
}
int32_t main(){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int _;
cin >> _;
while (_-->0) {
n_lamba_29();
}
return 0;
}