結果
| 問題 |
No.193 筒の数式
|
| コンテスト | |
| ユーザー |
あかりき
|
| 提出日時 | 2021-03-13 20:25:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 1,000 ms |
| コード長 | 450 bytes |
| コンパイル時間 | 160 ms |
| コンパイル使用メモリ | 82,188 KB |
| 実行使用メモリ | 52,352 KB |
| 最終ジャッジ日時 | 2024-10-15 10:30:22 |
| 合計ジャッジ時間 | 1,829 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
s=list(input())
ans=[]
for i in range(len(s)):
x=s[i:]+s[:i]
if x[0]!='+' and x[0]!='-' and x[-1]!='+' and x[-1]!='-':
ct=0
L=[]
for j in range(len(x)-1,-1,-1):
if x[j]=='+':
L.reverse()
ct+=int(''.join(L))
L=[]
elif x[j]=='-':
L.reverse()
ct-=int(''.join(L))
L=[]
else:
L.append(x[j])
L.reverse()
ct+=int(''.join(L))
ans.append(ct)
print(max(ans))
あかりき