結果

問題 No.273 回文分解
ユーザー rlangevinrlangevin
提出日時 2023-01-14 13:07:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 294 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 76,876 KB
最終ジャッジ日時 2023-08-26 19:28:58
合計ジャッジ時間 4,610 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,344 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 72 ms
71,296 KB
testcase_04 AC 70 ms
71,292 KB
testcase_05 AC 74 ms
75,036 KB
testcase_06 AC 75 ms
74,948 KB
testcase_07 AC 74 ms
71,292 KB
testcase_08 AC 78 ms
75,080 KB
testcase_09 AC 72 ms
75,072 KB
testcase_10 AC 71 ms
71,352 KB
testcase_11 AC 72 ms
71,336 KB
testcase_12 AC 71 ms
71,172 KB
testcase_13 AC 70 ms
71,172 KB
testcase_14 AC 80 ms
76,476 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 73 ms
71,096 KB
testcase_18 AC 71 ms
71,252 KB
testcase_19 AC 74 ms
75,004 KB
testcase_20 AC 71 ms
71,328 KB
testcase_21 AC 69 ms
71,348 KB
testcase_22 WA -
testcase_23 AC 80 ms
76,280 KB
testcase_24 AC 81 ms
76,504 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 81 ms
76,288 KB
testcase_28 AC 81 ms
76,244 KB
testcase_29 AC 78 ms
75,084 KB
testcase_30 AC 80 ms
76,236 KB
testcase_31 AC 71 ms
71,140 KB
testcase_32 AC 69 ms
71,464 KB
testcase_33 AC 70 ms
71,180 KB
testcase_34 AC 69 ms
71,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(L):
    N = len(L)
    temp = [None] * N
    for i in range(N):
        temp[i] = L[N - 1 - i]
    return L == temp

S = list(input())
M = len(S)
dp = [1] * M
for i in range(1, M):
    for j in range(i):
        if f(S[j+1:i+1]):
            dp[i] = max(dp[i], dp[j], i - j)
print(dp[-1])
0