# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1125180 | Nomio | XOR (IZhO12_xor) | C++20 | 2094 ms | 1096 KiB |
#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, x;
cin >> n >> x;
int a[n + 1], s[n + 1] {};
for(int i = 1; i <= n; i++) {
cin >> a[i];
s[i] = (s[i - 1] ^ a[i]);
}
int mx = 0, id = 0;
for(int i = 1; i <= n; i++) {
for(int j = i; j <= n; j++) {
if((s[j] ^ s[i - 1]) >= x) {
if(j - i + 1 > mx) {
mx = j - i + 1;
id = i;
}
}
}
}
cout << id << ' ' << mx << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |