#include <bits/stdc++.h>
#define ll long long
#define sz size()
#define pb push_back
#define all(x) x.begin() , x.end()
using namespace std;
int main()
{
ll n; cin >> n ; ll a[n] ;
map<int,int> mp ;ll mx = -1 ;
for (int i = 0; i < n; i++)
{
cin >> a[i]; mp[a[i]] ++ ;
mx = max(mx , a[i] );
}
for(auto &it: mp ){
it.second= it.second%2 ;
}
ll ans = 0 ; map<pair<int,int> , int > mp1 ;
for(int i = 0 ; i < mx+22 ; i ++ ){
for (int j = 0; j < mx+22 ; j ++)
{
if(mp[j]>0 && mp[i]>0 && i != j && mp1[{min ( i , j ) ,max(i , j ) }] == 0 ){
//cout<< i << " " << j << endl;
ans ^= (j + i) ;
mp1[ { min ( i , j ) ,max(i , j ) } ] = 1 ;
}
}
}
cout<<ans<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
398 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1667 ms |
123124 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1667 ms |
123124 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
398 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
398 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |