#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] );
}
ll ans = 0 ; map<pair<int,int> , int > mp1 ;
for(int i = 0 ; i < mx+22 ; i ++ ){
if(mp[i]==0)continue ;
if((mp[i]*(mp[i]+1)/2)%2) {
ans^=(i*2);
}
for(int j=i+1;j<=mx+22;++j) {
if(mp[i]&&mp[j]&&(mp[i]*mp[j]%2==1)) {
ans^=(i+j);
}
}}
cout<<ans<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
486 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
798 ms |
8416 KB |
Output is correct |
2 |
Correct |
841 ms |
12116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
798 ms |
8416 KB |
Output is correct |
2 |
Correct |
841 ms |
12116 KB |
Output is correct |
3 |
Execution timed out |
1625 ms |
61784 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
486 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
486 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |