# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
496774 | Nalrimet | XOR Sum (info1cup17_xorsum) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#pragma GCC optimization("g", on)
#pragma GCC optimize ("inline")
#pragma GCC optimization("03")
#pragma GCC optimization("unroll-loops")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popused,abm,mmx,avx,tune=native")
using namespace std;
const int N = 1e6 + 5;
const long long inf = 1000000000;
#define ll long long
#define F first
#define S second
#define pb push_back
int n, x[N];
//map<int, bool> used;
//map<int, int> cnt;
//vector<int> v;
long long res;
main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
for(int i = 1; i <= n; ++i){
cin >> x[i];
}
for(int i = 1; i <= n; ++i){
for(int j = i; j <= n; ++j){
res ^= x[i] + x[j];
}
}
cout << res;
}