Submission #1005731

#TimeUsernameProblemLanguageResultExecution timeMemory
100573112345678XOR (IZhO12_xor)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h>

using namespace std;

const int nx=250005;

int n, x, a[nx], qs[nx];
pair<int, int> mx;

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>n>>x;
    for (int i=1; i<=n; i++) cin>>a[i], qs[i]=a[i]^qs[i-1];
    for (int i=1; i<=n; i++)
    {
        for (int j=0; j<i; j++)
        {
            if ((qs[i]^qs[j])>x) mx=max(mx, {i-j, -j-1});
        }
    }
    cout<<-mx.second<<' '<<mx.first;
}
#Verdict Execution timeMemoryGrader output
Fetching results...