0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-18 13:51:58 +00:00
OI-codes/S2OJ/792/792.cpp

25 lines
449 B
C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
int n, q, a[200005], x, l, r, ans;
int main() {
std::ios::sync_with_stdio(false);
cin >> n >> q;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
while (q--) {
cin >> x >> l >> r;
ans = 0;
for (int i = l; i <= r; i++) {
ans = max(ans, (a[i] ^ x));
}
cout << ans << endl;
}
return 0;
}