69162023-12-19 17:51:50111Növekvő XORcpp17Time limit exceeded 45/1001.1s5756 KiB
#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>
using namespace std;

#define int long long
#define double long double

#define pii pair<int, int>

int random(int l, int h) {
	static mt19937 gen;
	return uniform_int_distribution<int>(l, h)(gen);
}

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifdef CB
	freopen("in.txt", "r", stdin);
//	freopen("out.txt", "w", stdout);
#endif
	int N;
	cin >> N;
	vector<int> v(N);
	for (int i = 0; i < N; i++) {
		cin >> v[i];
		multiset<int> s(v.begin(), v.begin() + i + 1);
		int x = 0;
		while (!s.empty()) {
			auto t = s.begin();
			while (t != s.end() && (x ^ *t) <= x) {
				t = next(t);
			}
			if (t == s.end()) {
				break;
			}
			x ^= *t;
			s.erase(t);
		}
		cout << (s.empty() ? "YES" : "NO") << '\n';
	}
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1960 KiB
2Accepted3ms2188 KiB
subtask210/10
3Accepted3ms2400 KiB
4Accepted3ms2580 KiB
5Accepted3ms2800 KiB
6Accepted3ms2896 KiB
7Accepted3ms3104 KiB
8Accepted3ms3192 KiB
9Accepted3ms3324 KiB
10Accepted3ms3412 KiB
subtask30/11
11Accepted3ms3636 KiB
12Accepted3ms3864 KiB
13Time limit exceeded1.1s4640 KiB
14Time limit exceeded1.078s4532 KiB
15Time limit exceeded1.062s4412 KiB
subtask435/35
16Accepted133ms3972 KiB
17Accepted141ms4000 KiB
18Accepted136ms3976 KiB
19Accepted136ms4184 KiB
20Accepted136ms4412 KiB
21Accepted143ms4384 KiB
22Accepted126ms4476 KiB
23Accepted128ms4556 KiB
subtask50/44
24Time limit exceeded1.07s5220 KiB
25Time limit exceeded1.026s5372 KiB
26Time limit exceeded1.067s5332 KiB
27Time limit exceeded1.082s5260 KiB
28Time limit exceeded1.067s5300 KiB
29Time limit exceeded1.075s5128 KiB
30Time limit exceeded1.05s5396 KiB
31Time limit exceeded1.088s5344 KiB
32Time limit exceeded1.052s5756 KiB
33Time limit exceeded1.07s5616 KiB