結果
問題 |
No.400 鏡
|
ユーザー |
|
提出日時 | 2017-08-12 11:16:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 316 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-10-13 04:46:03 |
合計ジャッジ時間 | 1,229 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 8 |
ソースコード
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()