問題一覧 > 通常問題

No.423 Hamster Language for Beginners (Numerals)

レベル : / AI推定難易度 : 115 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 577
作問者 : はむこ / テスター : りあん
お気に入りにしたユーザー ProblemId : 1306 / 自分の提出
問題文最終更新日: 2026-06-25 14:12:25
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 149 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。