diff --git a/S2OJ/792/792.cpp b/S2OJ/792/792.cpp new file mode 100644 index 00000000..72df53da --- /dev/null +++ b/S2OJ/792/792.cpp @@ -0,0 +1,24 @@ +#pragma GCC optimize("Ofast") + +#include + +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; +}