結果

問題 No.2204 Palindrome Splitting (No Rearrangement ver.)
ユーザー ntudantuda
提出日時 2023-02-06 20:12:38
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 321 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 82,240 KB
最終ジャッジ日時 2023-09-18 06:37:31
合計ジャッジ時間 6,354 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,236 KB
testcase_01 AC 73 ms
71,084 KB
testcase_02 AC 74 ms
71,232 KB
testcase_03 AC 1,478 ms
77,964 KB
testcase_04 AC 241 ms
77,436 KB
testcase_05 AC 157 ms
77,472 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = len(S)
T = S[::-1]
E = [[] for _ in range(N)]
for i in range(N + 1):
    for j in range(1, N - i + 1):
        if S[i:i + j] == T[N - i - j:N - i]:
            E[i].append(i + j)
dp = [0] * (N + 1)
dp[0] = N
for i in range(N):
    for j in E[i]:
        dp[j] = max(dp[j], min(dp[i], j - i))
print(dp[N])
0