Pro.ID22700 TitleRestoring the digits Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22700 AC0 Submit1 Ratio0.00% 时间&空间限制描述Let's consider arithmetic expressions (addition or subtraction) over non-negative decimal integers. The expression syntax is as follows:
The operands don't exceed 999 999 999. In case of subtraction the first operand should be greater than or equal to the second one. There are no spaces in the expression. Upper-case Latin letters are substituted for some digits (possibly including insignificant zeroes) so that identical letters correspond to identical digits and different letters correspond to different digits. It is guaranteed that at least one such substitution is made. The task is to restore the substituted digits. 输入Input data contains only one line with the encoded arithmetic expression. 输出Description Let's consider arithmetic expressions (addition or subtraction) over non-negative decimal integers. The expression syntax is as follows:
The operands don't exceed 999 999 999. In case of subtraction the first operand should be greater than or equal to the second one. There are no spaces in the expression. Upper-case Latin letters are substituted for some digits (possibly including insignificant zeroes) so that identical letters correspond to identical digits and different letters correspond to different digits. It is guaranteed that at least one such substitution is made. The task is to restore the substituted digits. Input Input data contains only one line with the encoded arithmetic expression. Output Output data consists of several lines. Each line describes one substitution and contains a letter and the corresponding digit. The letter and the digit should be separated by exactly one space. The strings should be sorted in the ascending order of letters. Letters not used in the substitution should not be listed. If the task has several solutions it is sufficient to give only one of them. Sample Input 103K+G0G1=CG36 Sample Output C 1 Source 样例输入103K+G0G1=CG36 样例输出C 1 作者 |