結果

問題 No.222 引き算と足し算
ユーザー r_ishida
提出日時 2025-06-01 18:45:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 1,000 ms
コード長 513 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2025-06-01 18:45:45
合計ジャッジ時間 2,270 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

s = S()

for i in range(1, len(s)):
    if s[i] == '+':
        ans = int(s[:i]) - int(s[i+1:])
        break
    if s[i] == '-':
        ans = int(s[:i]) + int(s[i+1:])
        break

print(ans)
0