Problem 3008 --three arrays

3008: three arrays

"
Time Limit $3$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $1$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
There are three integer arrays a,b,ca,b,c. The lengths of them are all NN. You are given the full contents of aa and bb. And the elements in cc is produced by following equation: c[i]=a[i] XOR b[i]c[i]=a[i] XOR b[i] where XORXOR is the bitwise exclusive or operation. 

Now you can rearrange the order of elements in arrays aa and bb independently before generating the array cc. We ask you to produce the lexicographically smallest possible array cc after reordering aa and bb. Please output the resulting array cc.
The first line contains an integer TT indicating there are TT tests. 

Each test consists of three lines. The first line contains one positive integer NNdenoting the length of arrays a,b,ca,b,c. The second line describes the array aa. The third line describes the array bb

T≤1000T≤1000 

1≤N≤1051≤N≤105 

* integers in arrays aa and bb are in the range of [0,230)[0,230)

* at most 66 tests with N>100
For each test, output a line containing NN integers, representing the lexicographically smallest resulting array cc.
1
3
3 2 1
4 5 6
4 4 7

推荐代码 查看3008 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$1928 $ms] 淡意的温柔 590709 2020-06-05 08:39:06
内存最少[$102028 $KB] 淡意的温柔 590709 2020-06-05 08:39:06
第一AC 淡意的温柔 590709 2020-06-05 08:39:06
第一挑战 淡意的温柔 590709 2020-06-05 08:39:06

赛题来源/所属竞赛 2019 Multi-University Training Contest 5 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛