# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90349 | kylych03 | XOR (IZhO12_xor) | C++14 | 2029 ms | 2336 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 a[100001];
int main(){
int n,k,i,j,res;
cin>>n>>k;
for(i=1;i<=n;i++)
cin>>a[i];
for(i=n;i>=1;i--){
res=0;
for(j=1;j<=i;j++){
res=(res^a[j]);
}
if(res>=k){
cout<<1<<" "<<i<<endl;
return 0;
}
for(;j<=n;j++){
res=(res^a[j]);
res=(res^a[j-i]);
if(res>=k){
cout<<j-i+1<<" "<<i<<endl;
return 0;
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |