제출 #1005732

#제출 시각아이디문제언어결과실행 시간메모리
100573212345678XOR (IZhO12_xor)C++17
0 / 100
2072 ms1884 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...