Submission #521802

# Submission time Handle Problem Language Result Execution time Memory
521802 2022-02-03T07:50:32 Z maks007 XOR Sum (info1cup17_xorsum) C++14
0 / 100
1600 ms 4404 KB
#include <bits/stdc++.h>

using namespace std;

int main(void) {
	int n;
	cin>> n;
	map <int,int> mp;
	vector <int> a(n);
	for(int i = 0; i < n; i ++ ) {
		cin >> a[i];
	}
	int ans = 0;
	for(int i = 0; i < n; i ++) {
		if(mp[a[i]]) {
			ans ^= mp[a[i]];
			continue;
		}
		int sum = 0;
		for(int j = i; j < n; j ++) {
			sum ^= (a[i] + a[j]);
		}
		mp[a[i]] = sum;
		ans ^= sum;
	}
	cout << ans;
	return false;
}
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1681 ms 4404 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1681 ms 4404 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -