結果
| 問題 |
No.222 引き算と足し算
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-01-09 22:38:51 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 1,000 ms |
| コード長 | 234 bytes |
| コンパイル時間 | 729 ms |
| コンパイル使用メモリ | 82,088 KB |
| 実行使用メモリ | 53,752 KB |
| 最終ジャッジ日時 | 2024-12-18 00:08:41 |
| 合計ジャッジ時間 | 2,854 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
S = input()
N = len(S)
ind = -1
for i in range(N - 1):
if str.isdigit(S[i]) and not str.isdigit(S[i + 1]):
ind = i + 1
op = S[ind]
a = int(S[:ind])
b = int(S[ind + 1:])
if op == "+":
print(a - b)
else:
print(a + b)
rlangevin