結果

問題 No.2204 Palindrome Splitting (No Rearrangement ver.)
ユーザー tailstails
提出日時 2023-02-03 22:32:12
言語 cLay
(20240420-1)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 2,346 ms
コンパイル使用メモリ 163,172 KB
実行使用メモリ 28,088 KB
最終ジャッジ日時 2023-09-15 18:38:42
合計ジャッジ時間 9,498 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,412 KB
testcase_01 AC 2 ms
5,416 KB
testcase_02 AC 2 ms
5,544 KB
testcase_03 AC 131 ms
23,740 KB
testcase_04 AC 36 ms
13,904 KB
testcase_05 AC 22 ms
11,568 KB
testcase_06 AC 228 ms
28,044 KB
testcase_07 AC 203 ms
27,720 KB
testcase_08 AC 184 ms
27,112 KB
testcase_09 AC 195 ms
27,620 KB
testcase_10 AC 228 ms
27,852 KB
testcase_11 AC 184 ms
27,024 KB
testcase_12 AC 226 ms
27,856 KB
testcase_13 AC 230 ms
27,900 KB
testcase_14 AC 228 ms
27,904 KB
testcase_15 AC 209 ms
27,776 KB
testcase_16 AC 86 ms
20,148 KB
testcase_17 AC 112 ms
22,368 KB
testcase_18 AC 230 ms
27,848 KB
testcase_19 AC 230 ms
27,848 KB
testcase_20 AC 230 ms
27,856 KB
testcase_21 AC 229 ms
28,088 KB
testcase_22 AC 231 ms
27,928 KB
testcase_23 AC 231 ms
27,992 KB
testcase_24 AC 229 ms
27,928 KB
testcase_25 AC 229 ms
27,896 KB
testcase_26 WA -
testcase_27 AC 147 ms
24,712 KB
testcase_28 AC 229 ms
27,844 KB
testcase_29 AC 229 ms
27,868 KB
testcase_30 AC 2 ms
5,388 KB
testcase_31 AC 2 ms
5,560 KB
testcase_32 AC 190 ms
26,284 KB
testcase_33 AC 230 ms
27,844 KB
testcase_34 AC 2 ms
5,612 KB
testcase_35 AC 190 ms
26,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

char s[5001];
int l;

char memo[5000][5000];

bool ispali(int a,int b){
	if(memo[a][b]){
		return memo[a][b]>0;
	}
	{
		bool z;
		if(a+1==b){
			z=true;
		}else if(a+2==b){
			z=s[a]==s[b-1];
		}else{
			z=ispali(a+1,b-1)&&s[a]==s[b-1];
		}
		memo[a][b]=z?1:-1;
		return z;
	}
}

int d[5001];

{
	rd(s@l);
	d[0]=l;
	rep(i,l){
		rep(j,i+1,l+1){
			if(ispali(i,j)){
				d[j]>?=min(d[i],j-i);
			}
		}
	}
	wt(d[l]);
}
0