제출 #882085

#제출 시각아이디문제언어결과실행 시간메모리
882085preskoXOR (IZhO12_xor)C++14
0 / 100
2044 ms3420 KiB
#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 timeMemoryGrader output
Fetching results...