結果
| 問題 | 
                            No.423 ハムスター語初級(数詞)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-11-04 14:28:21 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 38 ms / 2,000 ms | 
| コード長 | 344 bytes | 
| コンパイル時間 | 295 ms | 
| コンパイル使用メモリ | 82,488 KB | 
| 実行使用メモリ | 53,680 KB | 
| 最終ジャッジ日時 | 2024-11-04 14:28:23 | 
| 合計ジャッジ時間 | 1,762 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 | 
ソースコード
S = input()
N = []
i = 1
while i <= len(S):
    if S[-i] == "u":
        i += 4
        N.append(1)
    else:
        i += 3
        N.append(0)
ans = 0
for n in N[::-1]:
    ans *= 2
    ans += n
# print(ans)
ans *= 2
A = bin(ans)[2:]
for a in A:
    if a == "1":
        print("hamu", end="")
    else:
        print("ham", end="")
print()