Submission #389231

# Submission time Handle Problem Language Result Execution time Memory
389231 2021-04-14T01:24:55 Z rk42745417 XOR Sum (info1cup17_xorsum) C++17
0 / 100
263 ms 4216 KB
#include <bits/stdc++.h>
using namespace std;

#define EMT ios::sync_with_stdio(0); cin.tie(0);
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using ld = long double;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
const double EPS = 1e-9;

const int N = 4e3 + 25;

int cnt[N];

signed main() {
	int n;
	cin >> n;
	vector<int> arr(n);
	for(int i = 0; i < n; i++)
		cin >> arr[i], cnt[arr[i]]++;
	int ans = 0;
	for(int i = 0; i < N; i++) {
		for(int j = i + 1; j < N; j++)
			if((cnt[i] & 1) && (cnt[j] & 1))
				ans ^= i + j;
		if(1 <= cnt[i] && cnt[i] <= 2)
			ans ^= i + i;
	}
	cout << ans << '\n';
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 263 ms 4216 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 263 ms 4216 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -