Submission #992024

# Submission time Handle Problem Language Result Execution time Memory
992024 2024-06-03T15:21:50 Z ramalzaher XOR Sum (info1cup17_xorsum) C++14
0 / 100
877 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()
{
	int n; cin >> n ; int a[n] ; 
	map<int,int> mp ;int 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%=2 ; 
		}
		int ans = 0 ; 
	for(int i = 0 ; i < mx +1 ; i ++ ){
		for (int j = 0; j < mx + 1 ; j ++)
		{
			ans ^= (mp[j]*j + mp[i]*i) ;
		}
	}
	cout<<ans<<endl; 
   return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 515 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 877 ms 9044 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 877 ms 9044 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 515 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 515 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -