結果

問題 No.164 ちっちゃくないよ!!
ユーザー purple_jwlpurple_jwl
提出日時 2015-03-14 00:19:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 299 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 1,740 ms
コンパイル使用メモリ 74,408 KB
実行使用メモリ 48,612 KB
最終ジャッジ日時 2024-04-21 15:22:37
合計ジャッジ時間 4,382 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
41,728 KB
testcase_01 AC 123 ms
42,220 KB
testcase_02 AC 116 ms
42,108 KB
testcase_03 AC 113 ms
41,652 KB
testcase_04 AC 115 ms
41,964 KB
testcase_05 AC 299 ms
48,328 KB
testcase_06 AC 269 ms
48,504 KB
testcase_07 AC 223 ms
48,324 KB
testcase_08 AC 274 ms
48,612 KB
testcase_09 AC 270 ms
48,168 KB
testcase_10 AC 143 ms
43,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.math.*;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        boolean flg = true;
        BigInteger ans = BigInteger.ZERO;

        for(int i = 0; i < N; i++) {
        	String v = sc.next();
        	for(int radix = 2; radix < 37; radix++) {
        		try {
        			BigInteger tmp = new BigInteger(v, radix);
        			if(flg == true || ans.compareTo(tmp) == 1) {
        				ans = tmp;
        				flg = false;
        			}
        		}
        		catch(Exception e) {
        			// do nothing
        		}
        	}
        }

        System.out.println(ans);
    }

    public static void main(String[] args) {
        new Main().run();
    }
}
0