結果

問題 No.2204 Palindrome Splitting (No Rearrangement ver.)
ユーザー 👑 p-adicp-adic
提出日時 2023-05-31 16:18:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 476 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 175,812 KB
最終ジャッジ日時 2023-08-28 02:24:38
合計ジャッジ時間 13,499 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,260 KB
testcase_01 AC 72 ms
71,256 KB
testcase_02 AC 71 ms
71,020 KB
testcase_03 AC 273 ms
133,692 KB
testcase_04 AC 135 ms
88,340 KB
testcase_05 AC 117 ms
83,760 KB
testcase_06 AC 395 ms
175,100 KB
testcase_07 AC 366 ms
162,032 KB
testcase_08 AC 339 ms
156,736 KB
testcase_09 AC 421 ms
161,044 KB
testcase_10 AC 412 ms
175,424 KB
testcase_11 AC 337 ms
156,812 KB
testcase_12 AC 395 ms
174,616 KB
testcase_13 AC 389 ms
175,532 KB
testcase_14 AC 409 ms
175,504 KB
testcase_15 AC 404 ms
166,296 KB
testcase_16 AC 206 ms
111,268 KB
testcase_17 AC 253 ms
124,544 KB
testcase_18 AC 396 ms
175,528 KB
testcase_19 AC 422 ms
175,080 KB
testcase_20 AC 402 ms
175,436 KB
testcase_21 AC 383 ms
175,156 KB
testcase_22 AC 393 ms
175,544 KB
testcase_23 AC 396 ms
175,068 KB
testcase_24 AC 476 ms
175,348 KB
testcase_25 AC 460 ms
175,596 KB
testcase_26 AC 389 ms
175,812 KB
testcase_27 AC 321 ms
138,396 KB
testcase_28 AC 415 ms
175,444 KB
testcase_29 AC 386 ms
175,316 KB
testcase_30 AC 73 ms
71,108 KB
testcase_31 AC 73 ms
71,344 KB
testcase_32 AC 336 ms
148,076 KB
testcase_33 AC 407 ms
174,944 KB
testcase_34 AC 80 ms
70,948 KB
testcase_35 AC 333 ms
148,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

R=range
S=input()
N=len(S)
P=[0]*N
P[0]=[1]*2
for i in R(1,N):P[i]=[1if i<=j else(S[j]==S[i])*P[i-1][j+1]for j in R(i+2)]
D=[0]*N
D+=[N]
for i in R(N):
	for j in R(i+1):D[i]=max(D[i],min(D[j-1],i-j+1)*P[i][j])
print(D[-2])
0