|Online Judge||Problem Set||Authors||Online Contests||User|
Restoring the digits
Let's consider arithmetic expressions (addition or subtraction) over non-negative decimal integers. The expression syntax is as follows:
The operands don't exceed
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.
C 1 G 0 K 5
Northeastern Europe 2003, Western Subregion
[Submit] [Go Back] [Status] [Discuss]
Home Page Go Back To top
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator