結果

問題 No.423 ハムスター語初級(数詞)
ユーザー gorugo30gorugo30
提出日時 2021-02-23 21:27:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 81,252 KB
実行使用メモリ 53,304 KB
最終ジャッジ日時 2023-10-23 22:24:30
合計ジャッジ時間 2,816 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,304 KB
testcase_01 AC 35 ms
53,304 KB
testcase_02 AC 34 ms
53,304 KB
testcase_03 AC 34 ms
53,304 KB
testcase_04 AC 37 ms
53,304 KB
testcase_05 WA -
testcase_06 AC 37 ms
53,304 KB
testcase_07 AC 37 ms
53,304 KB
testcase_08 AC 38 ms
53,304 KB
testcase_09 AC 38 ms
53,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ham = ["ham", "hamu"]
zo = {"ham": 0, "hamu": 1}
n = input()
x = 0
while len(n) > 0:
    if n.startswith(ham[1]):
        x *= 2
        x += 1
        n = n[4:]
    else:
        x *= 2
        n = n[3:]
x *= 2
gyaku = []
while x > 0:
    gyaku.append(ham[x % 2])
    x //= 2
print("".join(gyaku[::-1]))
0