0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 15:56:26 +00:00

#792. [51nod 提高组400+试题 第二组]腿部挂件

https://sjzezoj.com/submission/23257
This commit is contained in:
Baoshuo Ren 2021-08-27 13:50:26 +08:00 committed by Baoshuo Ren
parent 1db7d7b9e0
commit 9a5c89eea8
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

24
S2OJ/792/792.cpp Normal file
View File

@ -0,0 +1,24 @@
#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;
}