제출 #1172180

#제출 시각아이디문제언어결과실행 시간메모리
1172180shahodXOR (IZhO12_xor)C++20
0 / 100
0 ms320 KiB
#include <bits/stdc++.h> using namespace std; void gojo() { long long n, x; cin >> n >> x; vector<long long> pre(n + 1); for (int i = 1; i <= n; i++) { long long x; cin >> x; pre[i] = pre[i - 1] ^ x; } long long l = 1, r = n, st = -1, k = 0; while (l <= r) { long long md = (l + r) / 2, j = -1; for (int i = 0; i <= n - md; i++) { if ((pre[i] ^ pre[i + md]) >= x) { j = i; break; } } if (~j) { st = j, k = md; l = md + 1; } else { r = md - 1; } } cout << st + 1 << ' ' << k; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; // cin >> t; while (t--) { gojo(); cout << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...