結果

問題 No.164 ちっちゃくないよ!!
ユーザー tsunabittsunabit
提出日時 2020-03-09 16:33:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 3,507 ms
コンパイル使用メモリ 77,872 KB
実行使用メモリ 55,124 KB
最終ジャッジ日時 2024-04-25 17:03:20
合計ジャッジ時間 5,786 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
54,148 KB
testcase_01 AC 130 ms
54,288 KB
testcase_02 AC 127 ms
54,136 KB
testcase_03 AC 125 ms
54,304 KB
testcase_04 AC 129 ms
54,140 KB
testcase_05 AC 189 ms
54,692 KB
testcase_06 AC 182 ms
54,560 KB
testcase_07 AC 163 ms
54,280 KB
testcase_08 AC 186 ms
55,124 KB
testcase_09 AC 177 ms
54,864 KB
testcase_10 AC 118 ms
53,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No164 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] v = new String[n];
		for(int i = 0; i < n; i++) {
			v[i] = sc.next();
		}
		char[] s = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
		long ans = Long.MAX_VALUE;
		
		for(int i = 0; i < n; i++) {
			int t = 0;
			
			for(int j = 0; j < v[i].length(); j++) {
				for(int k = 0; k < s.length; k++) {
					if(v[i].charAt(j) == s[k]) {
						t = Math.max(t, k);
						break;
					}
				}
			}
			ans = Math.min(ans, Long.parseLong(v[i], t+1));
		}
		System.out.println(ans);
	}
}
0