#CF801B. Valued Keys
Valued Keys
题目描述
You found a mysterious function . The function takes two strings and . These strings must consist only of lowercase English letters, and must be the same length.
The output of the function is another string of the same length. The -th character of the output is equal to the minimum of the -th character of and the -th character of .
For example, "ab", "ba" = "aa", and "nzwzl", "zizez" = "niwel".
You found two strings and of the same length and consisting of only lowercase English letters. Find any string such that , or print -1 if no such string exists.
输入格式
The first line of input contains the string .
The second line of input contains the string .
Both and consist only of lowercase English letters, and have same length and this length is between and .
输出格式
If there is no string such that , print -1.
Otherwise, print a string such that . If there are multiple possible answers, print any of them. The string should be the same length as and and consist only of lowercase English letters.
题目大意
找出来一个字符串s3,能让s1的第i位跟s3的第i位比较,二者最小的是s2的第i位 大小比较方法为比较字典序大小 Translated by @liyifeng
ab
aa
ba
nzwzl
niwel
xiyez
ab
ba
-1
提示
The first case is from the statement.
Another solution for the second case is "zizez"
There is no solution for the third case. That is, there is no such that "ab", "ba".