#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 |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
332 KB |
Output is correct |
2 |
Correct |
86 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
332 KB |
Output is correct |
2 |
Correct |
86 ms |
332 KB |
Output is correct |
3 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |