結果

問題 No.222 引き算と足し算
ユーザー syunsukesyunsuke
提出日時 2020-09-18 22:14:07
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 340 bytes
コンパイル時間 1,207 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 79,288 KB
最終ジャッジ日時 2023-09-04 11:00:07
合計ジャッジ時間 5,869 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,076 KB
testcase_01 AC 72 ms
71,164 KB
testcase_02 AC 73 ms
71,084 KB
testcase_03 AC 72 ms
71,192 KB
testcase_04 AC 73 ms
70,864 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 73 ms
71,220 KB
testcase_09 AC 70 ms
71,116 KB
testcase_10 AC 70 ms
71,168 KB
testcase_11 AC 73 ms
70,896 KB
testcase_12 AC 71 ms
71,084 KB
testcase_13 AC 71 ms
71,232 KB
testcase_14 AC 72 ms
71,276 KB
testcase_15 AC 75 ms
71,236 KB
testcase_16 AC 71 ms
70,896 KB
testcase_17 AC 73 ms
71,268 KB
testcase_18 RE -
testcase_19 AC 71 ms
71,240 KB
testcase_20 AC 70 ms
71,260 KB
testcase_21 AC 72 ms
70,740 KB
testcase_22 AC 72 ms
71,200 KB
testcase_23 AC 76 ms
71,288 KB
testcase_24 AC 77 ms
71,168 KB
testcase_25 AC 77 ms
71,012 KB
testcase_26 AC 72 ms
71,196 KB
testcase_27 AC 71 ms
71,100 KB
testcase_28 AC 72 ms
70,740 KB
testcase_29 RE -
testcase_30 AC 72 ms
71,192 KB
testcase_31 AC 72 ms
71,100 KB
testcase_32 AC 74 ms
71,236 KB
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

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 S[0]=="-":
    a,b=S[1:].split("-")
    print(int(-a)+int(b))
else:
    a,b=S.split("-")
    print(int(a)+int(b))
0