結果

問題 No.222 引き算と足し算
ユーザー norioc
提出日時 2024-07-16 21:49:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 1,000 ms
コード長 202 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 82,100 KB
実行使用メモリ 64,504 KB
最終ジャッジ日時 2024-07-16 21:49:05
合計ジャッジ時間 3,477 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

import re

S = input()

m = re.match('([+-]?\d+)([+-])([+-]?\d+)', S)
a, op, b = m.groups()
match op:
    case '+':
        ans = int(a) - int(b)
    case '-':
        ans = int(a) + int(b)

print(ans)
0