Submission #882082

#TimeUsernameProblemLanguageResultExecution timeMemory
882082preskoXOR (IZhO12_xor)C++17
0 / 100
1 ms2392 KiB
#include<iostream> #include<bits/stdc++.h> #define MAXN 250010 using namespace std; int a[MAXN]; long long pre[MAXN]; int main() { int n,l=0,r=0; long long x; 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){l=i;r=j;} } } cout<<l-1<<" "<<r-1<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...