No.423 Hamster Language for Beginners (Numerals)
Problem Statement
Hamsters, possessing advanced intelligence, have been remarkably active in international society.
It is only a matter of time before the hamster language replaces English as the next-generation lingua franca.
Being a person of foresight, you are starting by learning the numerals of the hamster language.
The numerals of the hamster language have the following characteristics.
・A numeral is a string consisting only of lowercase letters.
・It represents an integer greater than or equal to 0.
・It is a binary notation in which "hamu" represents 1 and "ham" represents 0.
・Just as leading zeros are not allowed in Arabic numerals, leading hams are not allowed in the hamster language.
For example,
・"hamuhamhamu" is 101 in binary, so it is a hamster language numeral representing 5 in decimal.
・"hamhamuhamu" is 011 in binary, but leading hams are not allowed, so it is not a hamster language numeral.
・"hamstring" means the muscles at the back of the thigh in English, but it is not a hamster language numeral.
Given a hamster language numeral, output the value multiplied by 2 as a hamster language numeral.
Input
$n$
$n$ is a string consisting only of lowercase letters.
$|n| \leq 50$
It is guaranteed that $n$ is a hamster language numeral.
Output
Output twice the input as a hamster language numeral.
Print a newline at the end.
Sample
Sample 1
Input
hamuhamhamu
Output
hamuhamhamuham
"hamuhamhamu" is 101 in binary, so it is 5 in decimal.
Doubling 5 gives 10, and 10 in binary notation is 1010.
Replacing 1 with hamu and 0 with ham gives hamuhamhamuham.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
はむこ
りあん