結果

問題 No.164 ちっちゃくないよ!!
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-19 20:51:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 828 bytes
コンパイル時間 2,184 ms
コンパイル使用メモリ 75,344 KB
実行使用メモリ 42,528 KB
最終ジャッジ日時 2024-04-21 15:24:03
合計ジャッジ時間 4,194 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,384 KB
testcase_01 AC 117 ms
39,984 KB
testcase_02 AC 116 ms
41,604 KB
testcase_03 AC 104 ms
40,088 KB
testcase_04 AC 115 ms
41,264 KB
testcase_05 AC 160 ms
42,272 KB
testcase_06 AC 154 ms
42,284 KB
testcase_07 AC 146 ms
41,636 KB
testcase_08 AC 157 ms
42,528 KB
testcase_09 AC 158 ms
42,396 KB
testcase_10 AC 123 ms
41,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
        String[] moto = new String[n];
        long[] chicchai = new long[n];
        for(int i=0; i<n; i++){
            moto[i] = koko.next();
            chicchai[i] = parse(moto[i], 'Z', 36);
        }
        Arrays.sort(chicchai);
        System.out.println(chicchai[0]);
    }
    static long parse(String moto, char sinsu, int sin){
        String s = String.valueOf(sinsu);
        if(moto.indexOf(s)!=-1){
            long a = Long.parseLong(moto, sin);
            return a;
        }else if(sinsu=='A'){
            return parse(moto, '9', 10);
        }else{
            return parse(moto, (char)(sinsu-1), sin-1);
        }
    }
}
0