# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
882085 | presko | XOR (IZhO12_xor) | C++14 | 2044 ms | 3420 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<iostream>
#include<bits/stdc++.h>
#define MAXN 250010
using namespace std;
int a[MAXN];
long long pre[MAXN];
int main()
{
int n,st=0;
long long x,best=0;
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n>>x;
for(int i=1;i<=n;i++)
{
cin>>a[i];
pre[i]=pre[i-1]^a[i];
}
for(int i=1;i<=n;i++)
{
for(int j=i;j<=n;j++)
{
long long curr=pre[j]^pre[i-1];
if(curr>=x && j-i+1>best){best=j-i+1;st=i;}
}
}
cout<<st<<" "<<best<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |