U480425 最大异或值

题目背景

myf 在 YZOI 中出了若干道和异或相关的题,比如 [**粒子对撞**](https://www.luogu.com.cn/problem/U373939) 和 [**模版 TWT**](https://www.luogu.com.cn/problem/U439241)。

题目描述

给定一个长度为 $n$ 的自然数序列 $a$。有 $Q$ 次询问,每次给定一个自然数 $x$,求: $$\displaystyle \max_{i=1}^n x \oplus a_i$$ 其中 $\oplus$ 代表异或运算。

输入格式

从标准读入中输入数据。 第一行包含二个正整数 $n$ 和 $Q$。 第二行包含 $n$ 个自然数 $a_1,a_2,a_3,\cdots,a_n$。 接下来 $Q$ 行,每行包含一个自然数 $x$。

输出格式

使用标准输出。 输出 $Q$ 行,每行一个自然数表示答案。

说明/提示

| 测试点编号 | $n,Q \le$ | $a_i,x \le$ | | :----------: | :----------: | :----------: | | $1 \sim 3$ | $10^4$ | $10^{18}$ | | $4 \sim 5$ | $2 \times 10^5$ | $10^4$ | | $6 \sim 7$ | $2 \times 10^5$ | $10^{18}$ | | $8 \sim 10$ | $2 \times 10^5$ | $10^{36}$ | 对于 $100\%$ 的数据,$1 \le n,Q \le 2 \times 10^5$,$0 \le a_i,x \le 10^{36}$,