結果

問題 No.273 回文分解
ユーザー yun_appyun_app
提出日時 2016-05-11 23:44:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 866 bytes
コンパイル時間 2,281 ms
コンパイル使用メモリ 72,512 KB
実行使用メモリ 51,376 KB
最終ジャッジ日時 2023-09-07 19:50:51
合計ジャッジ時間 5,574 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,540 KB
testcase_01 AC 46 ms
49,452 KB
testcase_02 AC 45 ms
49,424 KB
testcase_03 AC 44 ms
49,100 KB
testcase_04 AC 43 ms
49,208 KB
testcase_05 AC 45 ms
49,228 KB
testcase_06 AC 46 ms
49,280 KB
testcase_07 AC 44 ms
49,672 KB
testcase_08 AC 45 ms
49,328 KB
testcase_09 AC 46 ms
49,464 KB
testcase_10 AC 44 ms
49,148 KB
testcase_11 AC 46 ms
49,208 KB
testcase_12 AC 44 ms
49,252 KB
testcase_13 AC 42 ms
49,524 KB
testcase_14 AC 48 ms
49,904 KB
testcase_15 AC 44 ms
49,328 KB
testcase_16 AC 43 ms
49,164 KB
testcase_17 AC 42 ms
49,352 KB
testcase_18 AC 42 ms
49,256 KB
testcase_19 AC 44 ms
49,252 KB
testcase_20 AC 44 ms
49,260 KB
testcase_21 AC 44 ms
49,712 KB
testcase_22 AC 42 ms
49,436 KB
testcase_23 AC 44 ms
49,164 KB
testcase_24 AC 44 ms
49,292 KB
testcase_25 AC 44 ms
51,376 KB
testcase_26 AC 46 ms
49,572 KB
testcase_27 AC 44 ms
49,464 KB
testcase_28 AC 47 ms
49,432 KB
testcase_29 AC 48 ms
50,076 KB
testcase_30 AC 48 ms
48,080 KB
testcase_31 AC 42 ms
49,224 KB
testcase_32 AC 44 ms
49,452 KB
testcase_33 AC 43 ms
49,328 KB
testcase_34 AC 44 ms
49,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone{
    public static void main(String[] args) throws Exception{
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int max = line.length();
        int ans = 1;
        while(max-->0){
            for(int i=0;i<=line.length()-max;i++){
                if(check(line.substring(i,i+max))){
                    System.out.println(max);
                    return;
                }
            }
        }
        System.out.println(1);
    }
    public static boolean check(String line){
        int len = line.length();
        for(int i=0;i<len;i++){
            if(line.charAt(i) != line.charAt(len-i-1)){
                return false;
            }
        }
        return true;
    }
}
0