結果

問題 No.193 筒の数式
ユーザー sasa8uyauya
提出日時 2024-12-01 08:47:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 36 ms / 1,000 ms
コード長 233 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 53,612 KB
最終ジャッジ日時 2024-12-01 08:47:26
合計ジャッジ時間 1,564 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
n=len(s)
s=s+s
a=-10**10
for i in range(n):
	if (s[i] not in "+-") and (s[i+n-1] not in "+-"):
		q=[""]
		for c in s[i:i+n]:
			if c in "+-":
				q+=[""]
			if c!="+":
				q[-1]+=c
		a=max(a,sum(int(v) for v in q))
print(a)
0