mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 20:28:48 +00:00
parent
1db7d7b9e0
commit
9a5c89eea8
24
S2OJ/792/792.cpp
Normal file
24
S2OJ/792/792.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user