結果

問題 No.193 筒の数式
ユーザー tkzw_21tkzw_21
提出日時 2015-04-26 22:33:11
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 487 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 6,496 KB
実行使用メモリ 6,224 KB
最終ジャッジ日時 2023-09-18 12:04:42
合計ジャッジ時間 1,340 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,028 KB
testcase_01 WA -
testcase_02 AC 11 ms
6,028 KB
testcase_03 AC 10 ms
5,956 KB
testcase_04 AC 10 ms
6,020 KB
testcase_05 AC 10 ms
6,020 KB
testcase_06 AC 11 ms
6,028 KB
testcase_07 AC 10 ms
5,960 KB
testcase_08 AC 10 ms
6,164 KB
testcase_09 AC 10 ms
6,032 KB
testcase_10 AC 10 ms
6,024 KB
testcase_11 AC 10 ms
6,052 KB
testcase_12 AC 11 ms
6,084 KB
testcase_13 AC 10 ms
5,948 KB
testcase_14 AC 11 ms
6,040 KB
testcase_15 AC 11 ms
6,008 KB
testcase_16 AC 10 ms
5,964 KB
testcase_17 AC 11 ms
6,080 KB
testcase_18 AC 11 ms
6,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = raw_input()
n = len(s)
ret = -1000000000000

f = True
if s[0] == '+' or s[0] == '-':
		f = False
for j in range(0,len(s)-1):
	if not s[j].isdigit() and not s[j+1].isdigit():
		f = False
if f:
	ret = eval(s)

for i in range(1,n):
	t = str(s[-i:] + s[:n-i])
	# print t
	if not t[0].isdigit() or  not t[-1].isdigit():
		continue
	f = True
	for j in range(0,len(t)-1):
		if not t[j].isdigit() and not t[j+1].isdigit():
			f = False
	if f:
		# print t
		ret = max(ret,eval(t))

print ret
0