結果
問題 |
No.222 引き算と足し算
|
ユーザー |
|
提出日時 | 2019-08-13 13:33:10 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 1,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 236 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-19 13:23:54 |
合計ジャッジ時間 | 2,015 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
ソースコード
s = list(input()) for i in range(len(s)-1): if s[i].isdigit() == True and s[i+1].isdigit() == False: x = i+1 if s[x] == '+': s[x] = '-' else: s[x] = '+' s = ''.join(s) s = s.replace('--', '+') s = s.replace('+-', '-') s = s.replace('-+', '-') s = s.replace('++', '+') print(eval(s))