結果
| 問題 |
No.423 ハムスター語初級(数詞)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-02 07:27:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 343 bytes |
| コンパイル時間 | 206 ms |
| コンパイル使用メモリ | 82,388 KB |
| 実行使用メモリ | 53,288 KB |
| 最終ジャッジ日時 | 2024-11-25 01:23:57 |
| 合計ジャッジ時間 | 1,100 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 1 |
ソースコード
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()