当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6625:three arrays

题目描述
There are three integer arrays $a, b, c$. The lengths of them are all $N$. You are given the full contents of $a$ and $b$. And the elements in $c$ is produced by following equation: $c[i] = a[i]\ XOR\ b[i]$ where $XOR$ is the bitwise exclusive or operation.

Now you can rearrange the order of elements in arrays $a$ and $b$ independently before generating the array $c$. We ask you to produce the lexicographically smallest possible array $c$ after reordering $a$ and $b$. Please output the resulting array $c$.
输入解释
The first line contains an integer $T$ indicating there are $T$ tests.

Each test consists of three lines. The first line contains one positive integer $N$ denoting the length of arrays $a, b, c$. The second line describes the array $a$. The third line describes the array $b$.

* $T \le 1000$

* $1 \le N \le 10^5$

* integers in arrays $a$ and $b$ are in the range of $[0, 2^{30})$.

* at most $6$ tests with $N > 100$
输出解释
For each test, output a line containing $N$ integers, representing the lexicographically smallest resulting array $c$.
输入样例
1
3
3 2 1
4 5 6
输出样例
4 4 7
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6625

最后修改于 2020-10-25T23:32:56+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/2500MS(Java/Others) 262144/262144K(Java/Others)