結果

問題 No.222 引き算と足し算
ユーザー syunsukesyunsuke
提出日時 2020-09-18 22:17:23
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 404 bytes
コンパイル時間 988 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 78,992 KB
最終ジャッジ日時 2023-09-04 11:01:45
合計ジャッジ時間 4,893 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,332 KB
testcase_01 AC 75 ms
71,336 KB
testcase_02 AC 74 ms
71,416 KB
testcase_03 AC 75 ms
71,252 KB
testcase_04 AC 74 ms
71,312 KB
testcase_05 AC 74 ms
71,184 KB
testcase_06 AC 74 ms
70,996 KB
testcase_07 AC 75 ms
71,548 KB
testcase_08 AC 74 ms
71,212 KB
testcase_09 AC 75 ms
71,256 KB
testcase_10 AC 74 ms
71,132 KB
testcase_11 AC 76 ms
71,280 KB
testcase_12 AC 76 ms
71,536 KB
testcase_13 AC 75 ms
71,336 KB
testcase_14 AC 76 ms
71,192 KB
testcase_15 AC 76 ms
71,228 KB
testcase_16 AC 75 ms
71,332 KB
testcase_17 AC 76 ms
71,044 KB
testcase_18 RE -
testcase_19 AC 73 ms
71,424 KB
testcase_20 AC 76 ms
71,044 KB
testcase_21 AC 76 ms
71,456 KB
testcase_22 AC 74 ms
71,220 KB
testcase_23 AC 75 ms
71,184 KB
testcase_24 AC 74 ms
71,000 KB
testcase_25 AC 75 ms
71,184 KB
testcase_26 AC 74 ms
71,224 KB
testcase_27 AC 76 ms
71,332 KB
testcase_28 AC 76 ms
71,336 KB
testcase_29 AC 76 ms
71,160 KB
testcase_30 AC 77 ms
71,456 KB
testcase_31 AC 77 ms
71,200 KB
testcase_32 AC 78 ms
71,256 KB
testcase_33 AC 76 ms
71,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S=input()
if S[0]=="+":
    S=S[1:]
if "++" in S:
    a,b=S.split("++")
    print(int(a)-int(b))
elif "-+" in S:
    a,b=S.split("-+")
    print(int(a)+int(b))
elif "+" in S:
    a,b=S.split("+")
    print(int(a)-int(b))
elif "--" in S:
    a,b=S.split("--")
    print(int(a)-int(b))
elif S[0]=="-":
    a,b=S[1:].split("-")
    print(int(-a)+int(b))


else:
    a,b=S.split("-")
    print(int(a)+int(b))
0