# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
38922 | Talant | XOR (IZhO12_xor) | C++14 | 2000 ms | 4360 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>
#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
using namespace std;
typedef long long ll;
const int inf = (int)1e9 + 7;
const int N = (int)3e5 + 7;
int n,k;
int a[N];
int p[N];
int id,o;
int main () {
cin >> n >> k;
for (int i = 1; i <= n; i ++) {
cin >> a[i];
p[i] = (p[i - 1] ^ a[i]);
}
for (int i = 1; i <= n; i ++) {
for (int j = i; j <= n; j ++) {
if ((p[j] ^ p[i - 1]) >= k) {
if (o < (j - i + 1))
id = i,o = (j - i + 1);
}
}
}
cout << id << " " << o << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |