結果

問題 No.423 ハムスター語初級(数詞)
コンテスト
ユーザー turner18_jp
提出日時 2017-10-04 01:55:33
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 375 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 588 ms
コンパイル使用メモリ 20,568 KB
実行使用メモリ 20,444 KB
最終ジャッジ日時 2026-05-11 10:51:38
合計ジャッジ時間 3,627 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

s = input()
s = s.replace("h", " ").split()
binary = ""
ans = ""
for i, v in enumerate(s):
    if i == 0 and v == "am":
        break
    if v == "amu":
        binary = binary + "1"
    else:
        binary = binary + "0"

binary = str(bin(int(binary, 2) * 2))

for i in binary[2:]:
    if i == "1":
        ans = ans + "hamu"
    else:
        ans = ans + "ham"

print(ans)
0