#Lutece1582. 奇迹的魔法啊,再度出现!
奇迹的魔法啊,再度出现!
Migrated from Lutece 1582 奇迹的魔法啊,再度出现!
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
想对你说的话,如山似海。——
决战之后,魔法界和无魔法界分离,为了和再次相见,必须用经受考验,唤醒奇迹的魔法。
那考验就是——出现了个非负整数,
对于次询问,第次询问给定一个正整数,
输出$max\{a_1\;XOR\;x_j\;\;,\;\;a_2\;XOR\;x_j\;\;,\;\;{\ldots}\;\;,\;\;a_n\;XOR\;x_j\}$。
运算:,,,。
按位运算:对两个数的二进制位依次进行运算。
还对运算不懂的请去百度或谷歌一下:异或。
Input
输入的第一行为一个正整数,
接下来一行是个非负整数。
接下来为一个正整数,
接下来一行,为个非负整数。
Output
输出行,每行个值,表示所求答案。
Samples
5
1 8 0 5 14
5
7 14 10 4 2
15
15
15
12
12
Note
,
,
,
Resources
17暑假前集训-数据结构专题 By AutSky_JadeK,思路非原创