BorzeAI (CI翻译)
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number given its representation in Borze alphabet.
三进制记数法在 Berland 非常流行。为了用电报传输三进制数,人们使用 Borze 字母表。数字 0 表示为 «.»,数字 1 表示为 «-.»,数字 2 表示为 «--»。你的任务是解码 Borze 代码,即根据一个三进制数在 Borze 字母表中的表示形式,求出该三进制数。AI (CI翻译)
Input
输入格式
AI (CI翻译)The first line contains a number in Borze code. The length of the string is between 1 and 200 characters. It's guaranteed that the given string is a valid Borze code of some ternary number (this number can have leading zeroes).
第一行包含一个 Borze 代码。字符串长度在 1 到 200 个字符之间。保证给出的字符串是某个三进制数的有效 Borze 代码(该数可能包含前导零)。AI (CI翻译)
Output
输出格式
AI (CI翻译)Output the decoded ternary number. It can have leading zeroes.
输出解码后的三进制数。结果可能包含前导零。AI (CI翻译)
样例
.-.--
012
--.
20
-..-.--
1012
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。