結果

問題 No.222 引き算と足し算
ユーザー GrayCoder
提出日時 2018-10-10 02:25:26
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 1,000 ms
コード長 379 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-12 17:10:12
合計ジャッジ時間 2,158 ms
ジャッジサーバーID
(参考情報)
judge2 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

def main():
    XY = input()

    x = XY[0]
    for i, s in enumerate(XY[1:], start=1):
        if s in ('+', '-'):
            x = int(XY[:i])
            y = int(XY[i+1:])
            if s == '+':
                ans = x - y
            else:
                ans = x + y
            break
    print(ans)

input = lambda: stdin.readline().rstrip()
main()
0