結果

問題 No.193 筒の数式
ユーザー 👑 yumechiyumechi
提出日時 2015-04-27 00:37:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 809 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-09-18 12:28:53
合計ジャッジ時間 1,385 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,824 KB
testcase_01 AC 16 ms
7,836 KB
testcase_02 AC 16 ms
7,956 KB
testcase_03 AC 16 ms
7,768 KB
testcase_04 AC 16 ms
7,820 KB
testcase_05 AC 16 ms
7,820 KB
testcase_06 AC 16 ms
7,824 KB
testcase_07 AC 16 ms
7,756 KB
testcase_08 AC 16 ms
7,844 KB
testcase_09 AC 16 ms
7,784 KB
testcase_10 AC 16 ms
7,792 KB
testcase_11 WA -
testcase_12 AC 17 ms
7,900 KB
testcase_13 AC 17 ms
7,836 KB
testcase_14 AC 16 ms
7,900 KB
testcase_15 AC 16 ms
7,904 KB
testcase_16 WA -
testcase_17 AC 16 ms
7,796 KB
testcase_18 AC 16 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
maxnum = -9999999999999999999999999
length = len(S)
ckecknum = lambda x: not (x == "+" or x == "-")
for i in range(length):
    line = S[i:length] + S[0:i]

    tline = line
    while tline[0] == "0":
        tline = tline[1:len(tline)]
    j = 1
    while j < len(tline):
        if (tline[j - 1] == "+" or tline[j - 1] == "-") and tline[j] == "0":
            if j == len(tline) - 1:
                break
            else:
                if tline[j+1].isdigit():
                    tline = tline[0:j] + tline[j+1:len(tline)]
        else:
            j += 1
    line = tline

    first = line[0]
    end = line[len(line) - 1]
    if not ckecknum(first) or not ckecknum(end):
        continue
    
    try:
        maxnum = max(maxnum, eval(line))
    except:
        pass
print(maxnum)
     
0