Submission #1114012

#TimeUsernameProblemLanguageResultExecution timeMemory
111401212345678XOR Sum (info1cup17_xorsum)C++17
11 / 100
79 ms14920 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...