結果

問題 No.423 ハムスター語初級(数詞)
ユーザー tomatonosuke
提出日時 2016-09-22 23:56:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 321 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-17 15:15:15
合計ジャッジ時間 997 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 2 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

targ = input()
temp = ""
num = ""
for t in targ:
    temp += t
    if temp == "hamh":
        temp = "h"
        num += '0'
    elif temp == "hamu":
        temp = ""
        num += '1'
temp = bin(int(num,2) * 2)[2:]
ans = ""
for t in temp:
    if t == '0':
        ans += "ham"
    else:
        ans += "hamu"
print(ans)
0