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>
#define mp make_pair
#define F first
#define S second
#define eb emplace_back
#define printv(a, b) { \
for(auto pv : a) b << pv << " "; \
b << "\n"; \
}
using namespace std;
typedef long long ll;
using pii = pair<int, int>;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<ll> cnt(4001);
int ans = 0;
for(int i = 1; i <= n; i++){
int v;
cin >> v;
cnt[v]++;
}
for(int i = 1; i <= 4000; i++){
for(int j = 1; j < i; j++){
if(cnt[i] * cnt[j] % 2) ans ^= i + j;
//cerr << cnt[i] << " " << cnt[j] << " " << cnt[i] * cnt[j] << " " << i + j << " " << ans << "\n";
}
if(cnt[i] * (cnt[i] + 1) / 2 % 2) ans ^= i + i;
}
cout << ans << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |