22700_Restoringthedigits

2022-5-16 18:22| 发布者: Hocassian| 查看: 17| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506871080300-Problem List-采集的数据-后羿采集器.html

Pro.ID

22700

Title

Restoring the digits

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22700

AC

0

Submit

1

Ratio

0.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/32768 K (Java/Others)
  • 描述

    Let's consider arithmetic expressions (addition or subtraction) over non-negative decimal integers. The expression syntax is as follows:

    • the first operand;

    • the operator sign ('+' or '‑');

    • the second operand;

    • the character '=';

    • the result of the operation (sum or difference, according to the operator).

    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 first operand;

    • the operator sign ('+' or '‑');

    • the second operand;

    • the character '=';

    • the result of the operation (sum or difference, according to the operator).

    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
    G 0
    K 5

    Source

    样例输入

    103K+G0G1=CG36

    样例输出

    C 1
    G 0
    K 5

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部