From 9a5c89eea80853fff965682b3c10f963e2452b92 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Fri, 27 Aug 2021 13:50:26 +0800 Subject: [PATCH] =?UTF-8?q?#792.=20[51nod=20=E6=8F=90=E9=AB=98=E7=BB=84400?= =?UTF-8?q?+=E8=AF=95=E9=A2=98=20=E7=AC=AC=E4=BA=8C=E7=BB=84]=E8=85=BF?= =?UTF-8?q?=E9=83=A8=E6=8C=82=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://sjzezoj.com/submission/23257 --- S2OJ/792/792.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 S2OJ/792/792.cpp 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; +}