Submission #992030

# Submission time Handle Problem Language Result Execution time Memory
992030 2024-06-03T15:44:08 Z ramalzaher XOR Sum (info1cup17_xorsum) C++14
0 / 100
533 ms 131072 KB
#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 = i; j < mx+22 ; j ++)
		{
			if(mp[j]>0 && mp[i]>0 && i != j  ){
			//cout<< i << " " << j << endl; 
			ans ^= (j + i) ;
			}
		}
	}
	cout<<ans<<endl; 
   return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 393 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 533 ms 8280 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 533 ms 8280 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 393 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 393 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -