Submission #90349

#TimeUsernameProblemLanguageResultExecution timeMemory
90349kylych03XOR (IZhO12_xor)C++14
0 / 100
2029 ms2336 KiB
#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 timeMemoryGrader output
Fetching results...