6916 | 2023-12-19 17:51:50 | 111 | Növekvő XOR | cpp17 | Time limit exceeded 45/100 | 1.1s | 5756 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1960 KiB | ||||
2 | Accepted | 3ms | 2188 KiB | ||||
subtask2 | 10/10 | ||||||
3 | Accepted | 3ms | 2400 KiB | ||||
4 | Accepted | 3ms | 2580 KiB | ||||
5 | Accepted | 3ms | 2800 KiB | ||||
6 | Accepted | 3ms | 2896 KiB | ||||
7 | Accepted | 3ms | 3104 KiB | ||||
8 | Accepted | 3ms | 3192 KiB | ||||
9 | Accepted | 3ms | 3324 KiB | ||||
10 | Accepted | 3ms | 3412 KiB | ||||
subtask3 | 0/11 | ||||||
11 | Accepted | 3ms | 3636 KiB | ||||
12 | Accepted | 3ms | 3864 KiB | ||||
13 | Time limit exceeded | 1.1s | 4640 KiB | ||||
14 | Time limit exceeded | 1.078s | 4532 KiB | ||||
15 | Time limit exceeded | 1.062s | 4412 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 133ms | 3972 KiB | ||||
17 | Accepted | 141ms | 4000 KiB | ||||
18 | Accepted | 136ms | 3976 KiB | ||||
19 | Accepted | 136ms | 4184 KiB | ||||
20 | Accepted | 136ms | 4412 KiB | ||||
21 | Accepted | 143ms | 4384 KiB | ||||
22 | Accepted | 126ms | 4476 KiB | ||||
23 | Accepted | 128ms | 4556 KiB | ||||
subtask5 | 0/44 | ||||||
24 | Time limit exceeded | 1.07s | 5220 KiB | ||||
25 | Time limit exceeded | 1.026s | 5372 KiB | ||||
26 | Time limit exceeded | 1.067s | 5332 KiB | ||||
27 | Time limit exceeded | 1.082s | 5260 KiB | ||||
28 | Time limit exceeded | 1.067s | 5300 KiB | ||||
29 | Time limit exceeded | 1.075s | 5128 KiB | ||||
30 | Time limit exceeded | 1.05s | 5396 KiB | ||||
31 | Time limit exceeded | 1.088s | 5344 KiB | ||||
32 | Time limit exceeded | 1.052s | 5756 KiB | ||||
33 | Time limit exceeded | 1.07s | 5616 KiB |