結果

問題 No.423 ハムスター語初級(数詞)
ユーザー 👑 yumechiyumechi
提出日時 2016-11-02 07:27:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 82,476 KB
実行使用メモリ 53,316 KB
最終ジャッジ日時 2024-05-03 21:00:03
合計ジャッジ時間 977 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,188 KB
testcase_01 AC 36 ms
52,576 KB
testcase_02 AC 33 ms
52,612 KB
testcase_03 AC 33 ms
53,312 KB
testcase_04 AC 38 ms
52,708 KB
testcase_05 WA -
testcase_06 AC 33 ms
53,316 KB
testcase_07 AC 32 ms
52,864 KB
testcase_08 AC 36 ms
52,024 KB
testcase_09 AC 36 ms
52,240 KB
権限があれば一括ダウンロードができます

ソースコード

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.append(numarr[(ansnum & 1) ^ 1])
        ansnum >>= 1
    print("".join(ans[::-1]))

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