You are viewing a single comment's thread. Return to all comments →
t = int(input()) for t_itr in range(t): nq = input().split() n = int(nq[0]) q = int(nq[1]) x = list(map(int, input().rstrip().split())) for i in range(q): queries = list(map(int, input().rstrip().split())) z = [] if queries[1] - queries[2] == 0: z.append(queries[0] ^ x[queries[1] - 1]) else: for j in range(queries[1]-1, queries[2]): z.append(x[j] ^ queries[0]) print(max(z))
XOR key
You are viewing a single comment's thread. Return to all comments →