# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
497539 | thekcc | XOR (IZhO12_xor) | C++14 | 2076 ms | 1100 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;
const int N = 500001;
int pre[N],a[N];
int bi,bk,n,x;
int main(){
cin.tie(0)->sync_with_stdio(0);
cin >> n;
cin >> x;
pre[0]=0;
for(int i=1; i<=n; i++){
cin >> a[i];
pre[i]=pre[i-1]^a[i];
}
bi=-1;
bk=-1;
for(int k=n; k>=1; k--){
for(int i=0; i<=n-k; i++){
if(x<=(pre[k+i]^pre[i])) {
bi=i; bk=k;
break;
}
}
if(bi!=-1) break;
}
cout << bi+1 << " " << bk<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |