結果

問題 No.2204 Palindrome Splitting (No Rearrangement ver.)
ユーザー ニックネームニックネーム
提出日時 2023-02-03 22:02:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 330 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 520,012 KB
最終ジャッジ日時 2023-09-15 17:52:03
合計ジャッジ時間 13,398 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,312 KB
testcase_01 AC 69 ms
71,460 KB
testcase_02 AC 69 ms
71,412 KB
testcase_03 AC 181 ms
78,576 KB
testcase_04 AC 106 ms
77,628 KB
testcase_05 AC 99 ms
77,440 KB
testcase_06 AC 249 ms
78,568 KB
testcase_07 AC 272 ms
78,600 KB
testcase_08 AC 220 ms
78,284 KB
testcase_09 AC 369 ms
78,688 KB
testcase_10 AC 305 ms
78,784 KB
testcase_11 AC 211 ms
78,548 KB
testcase_12 AC 249 ms
78,620 KB
testcase_13 AC 260 ms
78,628 KB
testcase_14 AC 278 ms
78,748 KB
testcase_15 AC 297 ms
78,696 KB
testcase_16 AC 142 ms
78,176 KB
testcase_17 AC 179 ms
78,352 KB
testcase_18 AC 253 ms
78,480 KB
testcase_19 AC 317 ms
79,000 KB
testcase_20 AC 268 ms
78,712 KB
testcase_21 AC 248 ms
78,768 KB
testcase_22 AC 257 ms
78,660 KB
testcase_23 AC 269 ms
78,732 KB
testcase_24 AC 412 ms
78,980 KB
testcase_25 AC 342 ms
78,768 KB
testcase_26 AC 265 ms
78,908 KB
testcase_27 AC 299 ms
78,416 KB
testcase_28 AC 289 ms
78,748 KB
testcase_29 AC 261 ms
78,636 KB
testcase_30 AC 68 ms
71,340 KB
testcase_31 AC 68 ms
71,564 KB
testcase_32 TLE -
testcase_33 AC 306 ms
78,472 KB
testcase_34 AC 67 ms
71,408 KB
testcase_35 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input(); n = len(s)
rl = [{i-1} for i in range(n)]
for i in range(n-1):
    if s[i]==s[i+1]: rl[i+1].add(i-1)
for d in range(3,n+1):
    for l in range(-1,n-d):
        if s[l+1]==s[l+d] and l+1 in rl[l+d-1]: rl[l+d].add(l)
dp = [0]*n+[n]
for r in range(n):
    for l in rl[r]: dp[r] = max(dp[r],min(dp[l],r-l))
print(dp[n-1])
0