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>
using namespace std;
const int nx=1e6+5;
int n, a[nx], f[nx], res;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n;
for (int i=1; i<=n; i++) cin>>a[i], f[a[i]]++;
for (int i=1; i<=4000; i++) for (int j=i+1; j<=4000; j++) if ((f[i]%2)&&(f[j]%2)) res=res^(i+j);
for (int i=1; i<=4000; i++) if ((f[i]*(f[i]+1)/2)%2) res=(res^(2*i));
cout<<res;
}
# | 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... |