結果

問題 No.423 ハムスター語初級(数詞)
ユーザー ノットカワズノットカワズ
提出日時 2017-03-04 15:06:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 7,964 KB
最終ジャッジ日時 2023-09-05 05:22:58
合計ジャッジ時間 1,049 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,848 KB
testcase_01 AC 16 ms
7,864 KB
testcase_02 AC 16 ms
7,856 KB
testcase_03 AC 16 ms
7,828 KB
testcase_04 AC 16 ms
7,916 KB
testcase_05 AC 15 ms
7,856 KB
testcase_06 AC 15 ms
7,848 KB
testcase_07 AC 16 ms
7,840 KB
testcase_08 AC 15 ms
7,828 KB
testcase_09 AC 15 ms
7,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-


def to_num(hamu):
    num = hamu.replace('hamu', '1')
    num = num.replace('ham', '0')
    return int(num, 2) * 2


def to_hamu(num):
    hamu = bin(num)[2:]
    hamu = hamu.replace('1', 'hamu')
    hamu = hamu.replace('0', 'ham')
    return hamu


n = input()
num = to_num(n)
print(to_hamu(num))
0