結果

問題 No.273 回文分解
ユーザー 👑 KazunKazun
提出日時 2020-11-27 04:14:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 490 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 76,492 KB
最終ジャッジ日時 2023-10-01 03:53:46
合計ジャッジ時間 4,722 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,412 KB
testcase_01 AC 79 ms
75,536 KB
testcase_02 AC 71 ms
71,388 KB
testcase_03 AC 72 ms
71,288 KB
testcase_04 AC 73 ms
71,208 KB
testcase_05 AC 72 ms
71,336 KB
testcase_06 AC 78 ms
75,872 KB
testcase_07 AC 77 ms
75,584 KB
testcase_08 AC 84 ms
76,180 KB
testcase_09 AC 78 ms
75,508 KB
testcase_10 AC 72 ms
71,376 KB
testcase_11 AC 73 ms
71,384 KB
testcase_12 AC 74 ms
71,228 KB
testcase_13 AC 73 ms
71,416 KB
testcase_14 AC 85 ms
76,172 KB
testcase_15 AC 73 ms
71,096 KB
testcase_16 AC 72 ms
71,436 KB
testcase_17 AC 71 ms
71,360 KB
testcase_18 AC 71 ms
71,292 KB
testcase_19 AC 76 ms
75,508 KB
testcase_20 AC 72 ms
71,428 KB
testcase_21 AC 72 ms
71,452 KB
testcase_22 AC 84 ms
76,120 KB
testcase_23 AC 86 ms
76,140 KB
testcase_24 WA -
testcase_25 AC 85 ms
76,184 KB
testcase_26 AC 82 ms
75,676 KB
testcase_27 AC 77 ms
75,828 KB
testcase_28 AC 80 ms
75,720 KB
testcase_29 AC 95 ms
76,116 KB
testcase_30 AC 89 ms
76,060 KB
testcase_31 AC 71 ms
71,336 KB
testcase_32 WA -
testcase_33 AC 76 ms
71,408 KB
testcase_34 AC 75 ms
71,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def t(X):
    if X=="":
        return 0
    if len(X)==1:
        return 1

    K=-1
    I,J=0,len(X)-2

    while True:
        while True:
            if I>0 and X[I:J+1]==X[J:I-1:-1]:
                break

            if I==0 and X[:J+1]==X[J::-1]:
                break

            J-=1
        K=max(K,J-I+1)
        I=J+1
        J=len(X)-1

        if I==len(X):
            break
    return K

S=input()
K=-1

for i in range(len(S)):
    K=max(K,t(S[i:]),t(S[:-(i+1)]))
print(K)
0