結果

問題 No.273 回文分解
ユーザー kotatsugame
提出日時 2017-10-04 02:14:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 997 ms
コンパイル使用メモリ 65,584 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-16 06:25:56
合計ジャッジ時間 1,506 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 17 WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
string s;int ans;
main()
{
	cin>>s;
	for(int i=1;i<s.size();i++)
	{
		bool flag=true;
		for(int j=0;j<i;j++)
		{
			flag&=s[j]==s[i-j-1];
		}
		if(flag)ans=i;
	}
	cout<<ans<<endl;
}
0