結果

問題 No.193 筒の数式
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-04-27 08:22:22
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 1,000 ms
コード長 423 bytes
コンパイル時間 813 ms
コンパイル使用メモリ 6,708 KB
実行使用メモリ 6,320 KB
最終ジャッジ日時 2023-09-18 13:41:40
合計ジャッジ時間 2,125 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,088 KB
testcase_01 AC 12 ms
6,228 KB
testcase_02 AC 12 ms
6,248 KB
testcase_03 AC 12 ms
6,092 KB
testcase_04 AC 12 ms
6,320 KB
testcase_05 AC 12 ms
6,100 KB
testcase_06 AC 12 ms
6,096 KB
testcase_07 AC 12 ms
6,100 KB
testcase_08 AC 12 ms
6,092 KB
testcase_09 AC 13 ms
6,300 KB
testcase_10 AC 12 ms
6,148 KB
testcase_11 AC 12 ms
6,168 KB
testcase_12 AC 13 ms
6,160 KB
testcase_13 AC 13 ms
6,272 KB
testcase_14 AC 12 ms
6,092 KB
testcase_15 AC 12 ms
6,156 KB
testcase_16 AC 12 ms
6,100 KB
testcase_17 AC 12 ms
6,096 KB
testcase_18 AC 13 ms
6,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
import re
from itertools import chain
flatten = lambda listOfLists: chain.from_iterable(listOfLists)

s = raw_input()
hamark = float('-inf')
for i in xrange(len(s)):
    x = s[i:] + s[:i]
    z = re.split('\d+', x)
    if len(z[0] + z[-1]):
        continue
    y = map(int, re.split('[\\+|-]', x))
    z = z[1:]
    w = ''.join(map(str, flatten(zip(y, z))))
    hamark = max(hamark, eval(w))
print hamark
0