Given an array of N elements, answer Q queries asking if there exist two elements from two specified range with a given XOR value
Avoid non-standard headers. Especially giant composite-headers like &lt;bits/stdc++.h&gt;. They make your program unportable and/or  slow compilation down.
You are using using namespace std;.
That's a bad idea, read "Why is “using namespace std;” considered bad practice?".
Aside from its obscuring impact if you ever used the typedefs, vi and ll are unused. Remove to minimize confusion.
Do you know std::unordered_set? That's better for representing a set than std::unordered_map...
Anyway, you should change the algorithm but we'll get there later.
You should consider whether swapping the ranges can speed things up.
The conditional operator (ternary operator, exp ? true_exp : false_epp) is perfect for choosing the value to use.
You never check for input-failure or inputs being out-of-range.


Now the algorithm:

Consider initializing a std::unordered_multimap, or if duplicates are plentiful a std::unordered_map of sorted std::vector from the input-array.
Then for each query check every element in the smaller range whether element xor x is in the whole array, and filter that down to the second range.