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

建议使用的浏览器:

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

4665:Unshuffle

Special Judge 特殊评判
题目描述
A shuffle of two strings is formed by interspersing the characters into a new string, keeping the characters of each string in order. For example, MISSISSIPPI is a shuffle of MISIPP and SSISI. Let me call a string square if it is a shuffle of two identical strings. For example, ABCABDCD is square, because it is a shuffle of ABCD and ABCD, but the string ABCDDCBA is not square.
Given a square string, in which each character occurs no more than four times, unshuffle it into two identical strings.
输入解释
First line, number of test cases, T.
Following are 2*T lines. For every two lines, the first line is n, length of the square string; the second line is the string. Each character is a positive integer no larger than n.

T<=10, n<=2000.
输出解释
T lines. Each line is a string of length n of the corresponding test case. '0' means this character belongs to the first string, while '1' means this character belongs to the second string. If there are multiple answers, output any one of them.
输入样例
1
8
1 2 3 1 2 4 3 4
输出样例
00011011
来自杭电HDUOJ的附加信息
Recommend zhuyuanchen520

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

源链接: HDU-4665

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

共提交 0

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