Submission #1125180

#TimeUsernameProblemLanguageResultExecution timeMemory
1125180NomioXOR (IZhO12_xor)C++20
0 / 100
2094 ms1096 KiB
#include<bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, x;
	cin >> n >> x;
	int a[n + 1], s[n + 1] {};
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
		s[i] = (s[i - 1] ^ a[i]);
	}
	int mx = 0, id = 0;
	for(int i = 1; i <= n; i++) {
		for(int j = i; j <= n; j++) {
			if((s[j] ^ s[i - 1]) >= x) {
				if(j - i + 1 > mx) {
					mx = j - i + 1;
					id = i;
				}
			}
		}
	}
	cout << id << ' ' << mx << '\n';
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...