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

建议使用的浏览器:

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

3548:Restoring the digits

Special Judge 特殊评判
题目描述

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.

输入解释

The input contains only one line with the encoded arithmetic expression.

输出解释

The output 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.

输入样例
103K+G0G1=CG36
输出样例
C 1
G 0
K 5

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3548

最后修改于 2020-10-29T07:04:18+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536