結果

問題 No.222 引き算と足し算
ユーザー brthyyjpbrthyyjp
提出日時 2021-01-13 03:51:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 229 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 87,304 KB
実行使用メモリ 71,564 KB
最終ジャッジ日時 2023-08-13 23:54:53
合計ジャッジ時間 4,042 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,228 KB
testcase_01 AC 60 ms
71,252 KB
testcase_02 AC 61 ms
71,128 KB
testcase_03 AC 61 ms
71,292 KB
testcase_04 AC 66 ms
71,292 KB
testcase_05 AC 59 ms
71,392 KB
testcase_06 AC 59 ms
71,288 KB
testcase_07 AC 61 ms
71,396 KB
testcase_08 AC 62 ms
71,124 KB
testcase_09 AC 59 ms
71,184 KB
testcase_10 AC 60 ms
71,316 KB
testcase_11 AC 59 ms
71,416 KB
testcase_12 AC 58 ms
71,436 KB
testcase_13 AC 60 ms
71,416 KB
testcase_14 AC 60 ms
71,520 KB
testcase_15 AC 61 ms
71,384 KB
testcase_16 AC 60 ms
71,216 KB
testcase_17 AC 60 ms
71,288 KB
testcase_18 AC 60 ms
71,288 KB
testcase_19 AC 59 ms
71,352 KB
testcase_20 AC 60 ms
71,292 KB
testcase_21 AC 60 ms
71,288 KB
testcase_22 AC 59 ms
71,564 KB
testcase_23 AC 60 ms
71,320 KB
testcase_24 AC 58 ms
71,388 KB
testcase_25 AC 58 ms
71,208 KB
testcase_26 AC 60 ms
71,140 KB
testcase_27 AC 60 ms
71,460 KB
testcase_28 AC 59 ms
71,300 KB
testcase_29 AC 61 ms
71,284 KB
testcase_30 AC 60 ms
71,372 KB
testcase_31 AC 58 ms
71,456 KB
testcase_32 AC 60 ms
71,160 KB
testcase_33 AC 62 ms
71,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = str(input())
for i in range(1, len(s)):
    if not s[i].isdecimal() and s[i-1].isdecimal():
        op = s[i]
        break
if op == '+':
    ans = int(s[0:i])-int(s[i+1:])
else:
    ans = int(s[0:i])+int(s[i+1:])
print(ans)
0