#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll Size=1e5+1;
ll a[Size],ans[Size];
void solve(){
ll n,x;
cin>>n>>x;
for(ll i=0;i<n;i++){
cin>>a[i];
}
for(ll i=0;i<n;i++){
ll so_far=0;
for(ll j=i;j<n;j++){
so_far=so_far^a[j];
if(so_far>=x){
ans[i]=j-i+1;
}
}
}
pair<ll,ll> max_el={0,0};
for(ll i=0;i<n;i++){
max_el=max(max_el,{ans[i],i+1});
}
cout<<max_el.second<<" "<<max_el.first<<endl;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
ll t=1;
while(t--){
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
316 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Incorrect |
176 ms |
608 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |