#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x; cin >> n >> x;
vector<int> v(n+1);
for (int i = 1; i <= n; ++i) cin >> v[i];
int i = 0, k = 0;
for (int l = 1; l <= n; ++l){
int curx = 0;
for (int r = l; r <= n; ++r) {
curx ^= v[r];
if (curx >= x && r - l + 1 > k) k = r - l + 1, i = l;
}
}
cout << i << " " << k << "\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
304 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
2 ms |
212 KB |
Output is correct |
5 |
Correct |
176 ms |
468 KB |
Output is correct |
6 |
Correct |
312 ms |
568 KB |
Output is correct |
7 |
Correct |
311 ms |
568 KB |
Output is correct |
8 |
Correct |
392 ms |
604 KB |
Output is correct |
9 |
Execution timed out |
2067 ms |
1440 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |