結果

問題 No.164 ちっちゃくないよ!!
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-28 13:39:18
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 843 bytes
コンパイル時間 1,853 ms
コンパイル使用メモリ 71,920 KB
実行使用メモリ 58,072 KB
最終ジャッジ日時 2023-08-18 08:45:36
合計ジャッジ時間 4,409 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,756 KB
testcase_01 AC 122 ms
55,680 KB
testcase_02 AC 120 ms
56,520 KB
testcase_03 AC 120 ms
55,748 KB
testcase_04 AC 124 ms
55,872 KB
testcase_05 AC 169 ms
56,832 KB
testcase_06 AC 174 ms
56,412 KB
testcase_07 AC 165 ms
56,188 KB
testcase_08 AC 167 ms
54,612 KB
testcase_09 AC 167 ms
56,788 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long min=Long.MAX_VALUE;
        for(int i=0; i<N; i++){
            String S = sc.next();
            int L=S.length();
            int [] u = new int [L];
            int max=0;
            for(int j=0; j<L; j++){
                u[j] = S.charAt(j);
                if(u[j]>='0' && u[j]<='9'){
                    u[j]-='0';
                }else{
                    u[j]=u[j]-'A'+10;
                }
                max=Math.max(max,u[j]);
            }
            long num=0;
            for(int j=0; j<L; j++){
                num+=(long)Math.pow(max+1,L-1-j)*u[j];
            }
            min=Math.min(min,num);
        }
        System.out.println(min);
    }
}
0