# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1019283 | andrewp | XOR (IZhO12_xor) | C++17 | 2079 ms | 1624 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.
//Dedicated to my love, ivaziva
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
#define DBG(x) cout << #x << "= " << x << "\n"
const int mxN=2.5e5+1;
int n, x;
int a[mxN];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> x;
for(int i=1; i<=n; ++i) cin >> a[i];
int ans=0, p=0;
for(int i=1; i<=n; ++i) {
int xr=0;
for(int j=i; j<=n; j++) {
xr^=a[j];
if(xr>=x) {
if(j-i+1>ans) {
ans=j-i+1;
p=i;
}
}
}
}
cout << p << " " << ans << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |