結果
| 問題 |
No.222 引き算と足し算
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-23 10:28:37 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 1,000 ms |
| コード長 | 264 bytes |
| コンパイル時間 | 325 ms |
| コンパイル使用メモリ | 82,352 KB |
| 実行使用メモリ | 52,224 KB |
| 最終ジャッジ日時 | 2024-12-20 18:47:04 |
| 合計ジャッジ時間 | 3,072 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
S = input().rstrip()
x, y, op = "", "", ""
for i in range(len(S)):
if i != 0 and (S[i] == "+" or S[i] == "-"):
x = S[0:i]
y = S[i + 1:]
op = S[i]
break
x, y = int(x), int(y)
if op == "+":
print(x - y)
else:
print(x + y)