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

建议使用的浏览器:

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

6684:Rikka with Game

题目描述
Though both Rikka and Yuta are busy with study, on their common leisure, they always spend time with each other and sometimes play some interesting games.

Today, the rule of the game is quite simple. Given a string $s$ with only lowercase letters. Rikka and Yuta need to operate the string in turns while the first operation is taken by Rikka.

In each turn, the player has two choices: The first one is to terminate the game, and the second one is to select an index $i$ of $s$ and right shift the value of char $s_i$, i.e., $a \rightarrow b, b \rightarrow c, \dots, y \rightarrow z, z \rightarrow a$.

If the game is still alive after $2^{101}$ turns, i.e., after Yuta finishes his $2^{100}$ turns, the game will end automatically. The final result is the value of $s$ when the game is over.

Now, Rikka wants to minimize the lexicographical order of the result while Yuta wants to maximize it. You are required to calculate the result of the game if both Rikka and Yuta play optimally.

For two string $a$ and $b$ with equal length $m$, $a$ is lexicographically smaller than $b$ if and only if there exists an index $i \in [1,n]$ which satisfies $a_i < b_i$ and $a_j = b_j$ holds for all $j \in [1,i)$.
输入解释
The first line of the input contains an integer $T(1 \leq T \leq 100)$, the number of test cases.

For each test case, the input contains a single line with a single string with only lowercase letters, the initial value of $s(1 \leq |s| \leq 100)$.
输出解释
For each test case, output a single line with a single string, the answer.
输入样例
2
a
zbc
输出样例
a
bbc
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6684

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

共提交 0

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