結果

問題 No.400 鏡
ユーザー GrayCoderGrayCoder
提出日時 2017-08-12 11:16:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 9,084 KB
最終ジャッジ日時 2023-08-03 07:09:46
合計ジャッジ時間 2,335 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
9,012 KB
testcase_01 AC 25 ms
8,980 KB
testcase_02 AC 25 ms
8,996 KB
testcase_03 AC 25 ms
9,048 KB
testcase_04 AC 25 ms
9,084 KB
testcase_05 AC 26 ms
8,960 KB
testcase_06 AC 25 ms
8,944 KB
testcase_07 AC 25 ms
8,972 KB
testcase_08 AC 25 ms
8,956 KB
testcase_09 AC 25 ms
8,952 KB
testcase_10 AC 25 ms
8,884 KB
testcase_11 AC 24 ms
8,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re

def main():
    S = input()

    dic = {'<': '>', '>': '<'}
    after = multiple_replace(S, dic)
    print(after[::-1])

def multiple_replace(txt, dic):
    rx = re.compile('|'.join(map(re.escape, dic)))
    def one_xlat(match):
        return dic[match.group(0)]
    return rx.sub(one_xlat, txt)

main()
0