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

建议使用的浏览器:

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

6263:Rikka with String

题目描述
This is the last problem of this contest, so Rikka doesn't want to add a lengthy background to it. Let us make all the things simple and clear.

You have a string $s$ of length $n$ which only contains lowercase English letters from a to l (There are $12$ possible letters). You can choose a permutation of these $12$ letters $p_a,p_b,...,p_l$ and then you can get a string $t = p_{s_1}p_{s_2}...p_{s_n}$. Your task is to check whether the $i$th suffix (the substring $s[i,n]$) can become the largest suffix in lexicographic order after this modification.

输入解释
The first line contains a single number $t(1 \leq t \leq 10^3)$, the number of testcases.

For each testcase, the first line contains a string $s(1 \leq |s| \leq 10^5)$.

The input guarantees that there are at most $15$ testcases with $|s| > 10^3$.
输出解释
For each testcase, output a single line with a $01$ string of length $|s|$. If the $i$th suffix can become the largest one, the $i$th position should be $1$. Otherwise, it should be $0$.
输入样例
3
abaab
abcdefghijkllkjihgfedcba
aabbcccbaabcca
输出样例
01100
111111111111011111111110
10101000100000
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6263

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

共提交 0

通过率 --%
时间上限 内存上限
12000/6000MS(Java/Others) 512000/512000K(Java/Others)