0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

A - XOR Mixup

https://codeforces.com/contest/1698/submission/162060313
This commit is contained in:
Baoshuo Ren 2022-06-28 22:40:53 +08:00
parent 34492d4ba8
commit a2de5b7967
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

42
Codeforces/1698/A/A.cpp Normal file
View File

@ -0,0 +1,42 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 105;
int t, n, a[N];
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> t;
while (t--) {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i <= n; i++) {
int s = 0;
for (int j = 1; j <= n; j++) {
if (j != i) {
s ^= a[j];
}
}
if (s == a[i]) {
cout << a[i] << endl;
break;
}
}
}
return 0;
}