CF41C.Email address

普及-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Sometimes one has to spell email addresses over the phone. Then one usually pronounces a dot as dot, an at sign as at. As a result, we get something like vasyaatgmaildotcom. Your task is to transform it into a proper email address ([email protected]).

It is known that a proper email address contains only such symbols as . @ and lower-case Latin letters, doesn't start with and doesn't end with a dot. Also, a proper email address doesn't start with and doesn't end with an at sign. Moreover, an email address contains exactly one such symbol as @, yet may contain any number (possible, zero) of dots.

You have to carry out a series of replacements so that the length of the result was as short as possible and it was a proper email address. If the lengths are equal, you should print the lexicographically minimal result.

Overall, two variants of replacement are possible: dot can be replaced by a dot, at can be replaced by an at.

有时需要通过电话口述电子邮件地址。此时,人们通常将“.”念作“dot”,将“@”念作“at”。结果就得到了类似 vasyaatgmaildotcom 这样的字符串。你的任务是将其转换为一个合法的电子邮件地址([email protected])。

已知一个合法的电子邮件地址仅包含字符 .、@ 和小写拉丁字母,且不能以 . 开头或结尾;也不能以 @ 开头或结尾。此外,电子邮件地址中必须恰好包含一个 @ 符号,但可以包含任意数量(包括零个)的 . 符号。

你需要执行一系列替换操作,使得最终结果的长度尽可能短,且是一个合法的电子邮件地址。若存在多个长度相同的解,则输出字典序最小的结果。

总体而言,只允许两种替换方式:将字符串中的 dot 替换为 .,将 at 替换为 @。

输入格式

The first line contains the email address description. It is guaranteed that that is a proper email address with all the dots replaced by dot an the at signs replaced by at. The line is not empty and its length does not exceed 100 symbols.

第一行包含邮箱地址的描述。保证该描述是一个合法的邮箱地址,其中所有的英文句点(.)均被替换为字符串 dot,所有的 @ 符号均被替换为字符串 at。该行非空,且长度不超过 100 个字符。

输出格式

Print the shortest email address, from which the given line could be made by the described above replacements. If there are several solutions to that problem, print the lexicographically minimal one (the lexicographical comparison of the lines are implemented with an operator < in modern programming languages).

In the ASCII table the symbols go in this order: . @ ab...z

输出能通过上述替换操作生成给定字符串的最短邮箱地址。若存在多个满足条件的解,则输出字典序最小的一个(现代编程语言中字符串的字典序比较由运算符 < 实现)。

在 ASCII 表中,字符的顺序为:. @ a b ... z

输入输出样例

  • 输入#1

    vasyaatgmaildotcom

    输出#1

    [email&#160;protected]
  • 输入#2

    dotdotdotatdotdotat

    输出#2

    [email&#160;protected]
  • 输入#3

    aatt

    输出#3

    a@t

输入解题思路,AI测评打分。不知道怎么写?

首页