結果

問題 No.193 筒の数式
ユーザー akitsugu777akitsugu777
提出日時 2019-08-14 17:32:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 409 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 11,944 KB
実行使用メモリ 10,192 KB
最終ジャッジ日時 2023-10-19 18:11:27
合計ジャッジ時間 1,559 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,192 KB
testcase_01 AC 29 ms
10,192 KB
testcase_02 AC 29 ms
10,192 KB
testcase_03 AC 29 ms
10,192 KB
testcase_04 AC 30 ms
10,192 KB
testcase_05 AC 30 ms
10,192 KB
testcase_06 AC 30 ms
10,192 KB
testcase_07 AC 29 ms
10,192 KB
testcase_08 AC 30 ms
10,192 KB
testcase_09 AC 28 ms
10,192 KB
testcase_10 AC 29 ms
10,192 KB
testcase_11 AC 29 ms
10,192 KB
testcase_12 AC 28 ms
10,192 KB
testcase_13 AC 29 ms
10,192 KB
testcase_14 AC 28 ms
10,192 KB
testcase_15 AC 29 ms
10,192 KB
testcase_16 AC 29 ms
10,192 KB
testcase_17 AC 28 ms
10,192 KB
testcase_18 AC 28 ms
10,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x):
    x = x.replace('+', ' + ').replace('-', ' - ')
    L = []
    for i in x.split():
        if i in '+-':
            L += i
        else:
            L += str(int(i))
    return ''.join(L)

s = list(input())

L1 = []
for _ in range(len(s)):
    t = s.pop(0)
    s += t
    if s[0] not in '+-' and s[-1] not in '+-':
        L1 += [''.join(s)]
        
L2 = [eval(f(i)) for i in L1]

print(max(L2))
0