Finding the largest of a series of numbers being XORed
Putting all variables of the same type onto a single line can be bad for readability and maintenance:


unsigned int T,N,Q,i,a,p,q,count,max,n[100000],res[100000];



Since the single-character variables are similar, they can still be together.  The rest of them, however, should be on separate lines.  Also, since i is a loop counter, it's best to declare it as close as possible to its for loop instead.

unsigned int T, N, Q, a, p, q;
unsigned int count;
unsigned int max;
unsigned int n[100000]
unsigned int res[100000];