結果

問題 No.164 ちっちゃくないよ!!
ユーザー purple_jwl
提出日時 2015-03-14 00:19:52
言語 Java
(openjdk 23)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 2,276 ms
コンパイル使用メモリ 74,968 KB
実行使用メモリ 48,380 KB
最終ジャッジ日時 2024-10-13 14:12:27
合計ジャッジ時間 5,411 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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