結果

問題 No.164 ちっちゃくないよ!!
ユーザー YamaKasaYamaKasa
提出日時 2018-07-25 00:36:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 901 bytes
コンパイル時間 2,114 ms
コンパイル使用メモリ 74,780 KB
実行使用メモリ 56,920 KB
最終ジャッジ日時 2023-09-06 04:54:57
合計ジャッジ時間 4,878 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,140 KB
testcase_01 AC 122 ms
55,868 KB
testcase_02 AC 120 ms
56,464 KB
testcase_03 AC 124 ms
55,844 KB
testcase_04 AC 127 ms
55,772 KB
testcase_05 AC 180 ms
56,920 KB
testcase_06 AC 203 ms
56,468 KB
testcase_07 AC 179 ms
56,692 KB
testcase_08 AC 199 ms
56,868 KB
testcase_09 AC 198 ms
56,704 KB
testcase_10 AC 127 ms
56,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		String[] V = new String[N];
		for(int i = 0; i < N; i++) {
			V[i] = scan.next();
		}
		scan.close();

		// 'A' = 65, '1' = 49
		long min = Long.MAX_VALUE;
		for(int i = 0; i < N; i++) {
			String s = V[i];
			int max = 0;
			for(int j = 0; j < s.length(); j++) {
				char c = s.charAt(j);
				if(max < (int)c) {
					max = (int)c;
				}
				//System.out.println((int)c);
			}
			if(max <= 58) {
				max = 1 + max - 48;
			}else {
				max = 10 + max - 64;
				//System.out.println(max);
			}
			//System.out.println(max);
			for(int j = max; j <= 36; j++) {
				long num = Long.parseLong(Long.toString(Long.parseLong(s, j), 10));
				//System.out.println(num);
				if(min > num) {
					min = num;
				}
			}
		}
		System.out.println(min);
	}
}
0