# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
755510 | Desh03 | XOR (IZhO12_xor) | C++17 | 2057 ms | 1868 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, x, k = -1, id;
cin >> n >> x;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
vector<int> pre(n + 1);
for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] ^ a[i - 1];
for (int i = 0; i < n; i++)
for (int j = i + 1; j <= n; j++)
if ((pre[j] ^ pre[i]) >= x && j - i > k)
k = j - i, id = i + 1;
cout << id << ' ' << k;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |