結果

問題 No.193 筒の数式
ユーザー fmhrfmhr
提出日時 2015-04-27 00:41:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 314 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 9,104 KB
最終ジャッジ日時 2023-09-18 12:30:16
合計ジャッジ時間 1,747 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
9,044 KB
testcase_01 AC 24 ms
9,056 KB
testcase_02 AC 24 ms
9,064 KB
testcase_03 AC 24 ms
8,980 KB
testcase_04 AC 24 ms
8,932 KB
testcase_05 AC 24 ms
8,984 KB
testcase_06 AC 24 ms
9,104 KB
testcase_07 AC 24 ms
9,100 KB
testcase_08 AC 23 ms
8,976 KB
testcase_09 AC 25 ms
8,964 KB
testcase_10 AC 25 ms
9,008 KB
testcase_11 AC 24 ms
9,000 KB
testcase_12 AC 24 ms
9,012 KB
testcase_13 AC 23 ms
8,920 KB
testcase_14 AC 23 ms
9,044 KB
testcase_15 AC 24 ms
9,008 KB
testcase_16 AC 24 ms
9,004 KB
testcase_17 AC 24 ms
9,012 KB
testcase_18 AC 24 ms
8,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re
S = str(input())
ans = re.sub(r'\b0+(?!\b)', '', S)
ans = eval(ans)
for i in range(1, len(S)):
    s = S[i:]+S[:i]
    s = re.sub(r'\b0+(?!\b)', '', s)
    # print(s)
    if s[0] in '+-' or s[len(s)-1] in '+-':
        continue
    try:
        ans = max(ans, eval(s))
    except:
        pass
print(ans)
0