結果

問題 No.193 筒の数式
ユーザー kyo1kyo1
提出日時 2020-12-08 02:51:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 413 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 11,976 KB
実行使用メモリ 10,088 KB
最終ジャッジ日時 2023-10-17 16:53:24
合計ジャッジ時間 1,496 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

S = input()


def check(s):
    if s.startswith("+") or s.startswith("-"):
        return False
    if s.endswith("+") or s.endswith("-"):
        return False
    for i in range(len(s) - 1):
        if s[i] in "-+" and s[i + 1] in "-+":
            return False
    return True


res = 0
for i in range(len(S)):
    T = S[i:] + S[:i]
    if not check(T):
        continue
    res = max(res, eval(T))

print(res)
0