# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
867656 |
2023-10-29T04:39:19 Z |
sleepntsheep |
XOR (IZhO12_xor) |
C++17 |
|
1 ms |
348 KB |
#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <set>
#include <utility>
#include <array>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define ShinLena cin.tie(nullptr)->sync_with_stdio(false);
using ll = long long;
#define N 200005
int n, x, a[N], fw[N], c[N<<1], C;
pair<int, int> ans;
inline void upd(int p, int k) { for (; p; p-=p&-p) fw[p] = max(fw[p], k); }
inline int qry(int p) { int z = 0; for (; p<N; p+=p&-p) z = max(z, fw[p]); return z; }
int main()
{
ShinLena;
cin >> n >> x;
c[C++] = x;
for (int i = 1; i <= n; ++i) cin >> a[i], a[i] ^= a[i-1], c[C++] = a[i], c[C++] = a[i] ^ x;
sort(c, c+C); C = unique(c, c+C) - c;
for (int i = n; i >= 1; --i)
{
int w = 1+lower_bound(c, c+C, x ^ a[i-1]) - c, j = qry(w);
ans = max(ans, {j-i+1, -i});
upd(1+lower_bound(c, c+C, a[i])-c, i);
}
cout << -ans.second << ' ' << ans.first;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |