結果

問題 No.222 引き算と足し算
ユーザー Ribura
提出日時 2020-05-30 00:38:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 525 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-06 10:05:01
合計ジャッジ時間 2,600 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

xopy = readline().rstrip().decode()
x = 1
xx = ''
flag = False
if xopy[0] == '-':
    x *= -1
    xopy = xopy[1:]
yy = ''
for xy in xopy:
    if flag:
        yy += xy
    else:
        if xy == '+':
            y = -1
            flag = True
        elif xy == '-':
            y = 1
            flag = True
        else:
            xx += xy
print(x * int(xx) + y * int(yy))
0