Submission #389236

# Submission time Handle Problem Language Result Execution time Memory
389236 2021-04-14T01:30:40 Z rk42745417 XOR Sum (info1cup17_xorsum) C++17
11 / 100
263 ms 8268 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((1LL * cnt[i] * (cnt[i] + 1) / 2) & 1)
			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 Correct 263 ms 4216 KB Output is correct
2 Correct 247 ms 8260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 263 ms 4216 KB Output is correct
2 Correct 247 ms 8260 KB Output is correct
3 Runtime error 7 ms 8268 KB Execution killed with signal 11
4 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 -