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

建议使用的浏览器:

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

4657:Find Permutation

Special Judge 特殊评判
题目描述
Given b0, b1, ..., bn-1, find two permutations {ai}, {ci} of 0..n-1 such that ai+bi=ci (mod n) for every i.
输入解释
First line, number of test cases, T.
Following are 2*T. For every two lines, the first line is n and the second line contains n integers.

Sum of all n <= 105.
0<=bi<n
It's guaranteed that there exists a solution.
Test data is generated by randomly choosing two permutations and subtracting one from the other.
输出解释
2*T lines. Every line contains n integers. For every two lines, the first line represents {ai} and the second line represents {ci}.
If there are multiple solutions, output any one of them.
输入样例
1
3
0 1 2
输出样例
2 0 1
2 1 0
来自杭电HDUOJ的附加信息
Recommend zhuyuanchen520

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

源链接: HDU-4657

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)