結果

問題 No.273 回文分解
ユーザー 184184
提出日時 2015-08-28 22:41:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 39,244 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-25 00:07:47
合計ジャッジ時間 1,581 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 WA -
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 WA -
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 WA -
testcase_30 AC 2 ms
4,380 KB
testcase_31 WA -
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cstdlib>

using namespace std;

//namaega184 

int main(){
	char s[51];scanf("%s",s);
	int len=strlen(s),ans=0; 
	int cnt=0;
	for(int i=0;i<len;i++){
		for(int j=i+1;j<len;j++){
			bool f=1;
			for(int a=i,b=j;a<b;a++,b--){
				if(s[a]!=s[b]){f=0;break;}
			}
			if(f){if(j+1-i>ans)ans=j+1-i;}
		}
	}
	printf("%d\n",ans);
	return 0;
}
0