結果

問題 No.273 回文分解
ユーザー ルッツファン
提出日時 2015-11-28 03:15:01
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 912 bytes
コンパイル時間 3,437 ms
コンパイル使用メモリ 74,592 KB
実行使用メモリ 53,504 KB
最終ジャッジ日時 2024-12-23 13:12:23
合計ジャッジ時間 7,188 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 17 WA * 15
権限があれば一括ダウンロードができます

ソースコード

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();
		        StringBuffer sc = new StringBuffer(tre);
//		        System.out.println(i+":"+sb.toString());
//		        System.out.println(i+":"+sc.toString());
		        if(sb.toString().equals(sc.toString())){
		        	System.out.println(sb.length());
		        	System.exit(0);
		        }
			}
			
			
	}

}
0