結果

問題 No.193 筒の数式
ユーザー kmjp
提出日時 2015-04-27 00:21:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 1,000 ms
コード長 292 bytes
コンパイル時間 541 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-05 03:16:44
合計ジャッジ時間 975 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
import re

mi=-1<<60
S=raw_input().strip()

for i in range(11):
	S=S[1:]+S[0]
	if S[0]=='+':
		continue
	if S[0]=='-':
		continue
	if S[-1]=='+':
		continue
	if S[-1]=='-':
		continue
	s = re.sub(r'(\d+)', lambda m:str(int(m.group())), S)
	mi=max(mi,eval(s))

print mi
0