結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,236 KB
testcase_01 AC 73 ms
71,324 KB
testcase_02 AC 73 ms
71,428 KB
testcase_03 AC 72 ms
71,448 KB
testcase_04 AC 75 ms
71,264 KB
testcase_05 WA -
testcase_06 AC 71 ms
71,344 KB
testcase_07 AC 71 ms
71,336 KB
testcase_08 AC 69 ms
71,296 KB
testcase_09 AC 71 ms
71,400 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