結果

問題 No.273 回文分解
コンテスト
ユーザー ルッツファン
提出日時 2015-11-28 03:10:23
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
WA  
実行時間 -
コード長 734 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,373 ms
コンパイル使用メモリ 81,200 KB
実行使用メモリ 39,552 KB
最終ジャッジ日時 2026-05-29 13:21:17
合計ジャッジ時間 4,820 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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