結果

問題 No.273 回文分解
ユーザー ルッツファンルッツファン
提出日時 2015-11-28 03:10:23
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 734 bytes
コンパイル時間 4,150 ms
コンパイル使用メモリ 74,884 KB
実行使用メモリ 50,588 KB
最終ジャッジ日時 2024-12-23 13:12:16
合計ジャッジ時間 6,476 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class yukicoder010 {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tes = null;
		
			try {
				tes = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			
			String tre;
			
			for(int i=1;i<tes.length();i++){
				tre = tes.substring(0, tes.length() - i);
				StringBuffer sb = new StringBuffer(tre);
		        sb.reverse();
		        if(sb.equals(tre)){
		        	System.out.println(sb.length());
		        	System.exit(0);
		        }
			}
			
			
	}

}
0