Submission #992032

# Submission time Handle Problem Language Result Execution time Memory
992032 2024-06-03T15:49:31 Z ramalzaher XOR Sum (info1cup17_xorsum) C++14
11 / 100
1600 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] );  
	}
		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;
}
# Verdict Execution time Memory Grader output
1 Runtime error 486 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 798 ms 8416 KB Output is correct
2 Correct 841 ms 12116 KB Output is correct
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Runtime error 486 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 486 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -