結果

問題 No.423 ハムスター語初級(数詞)
ユーザー 👑 yumechiyumechi
提出日時 2016-11-02 07:20:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 71,688 KB
最終ジャッジ日時 2023-08-16 12:34:21
合計ジャッジ時間 1,789 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def solve():
    numarr = ["hamu", "ham"]
    s = input()
    numstr = ""
    for idx in range(2):
        s = s.replace(numarr[idx], str(1 - idx))
    ansnum = int(s, 2) * 2
    ans = ""
    while ansnum > 0:
        ans += numarr[ansnum & 1]
        ansnum >>= 1
    print(ans)

if __name__=="__main__":
    solve()
0