結果
問題 | No.164 ちっちゃくないよ!! |
ユーザー | ki_ki33 |
提出日時 | 2015-03-12 23:50:51 |
言語 | Java19 (openjdk 21) |
結果 |
AC
|
実行時間 | 194 ms / 2,000 ms |
コード長 | 1,220 bytes |
コンパイル時間 | 2,297 ms |
コンパイル使用メモリ | 76,652 KB |
実行使用メモリ | 56,800 KB |
最終ジャッジ日時 | 2023-08-03 17:04:43 |
合計ジャッジ時間 | 4,890 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 128 ms
55,860 KB |
testcase_01 | AC | 128 ms
55,968 KB |
testcase_02 | AC | 128 ms
55,956 KB |
testcase_03 | AC | 129 ms
55,848 KB |
testcase_04 | AC | 131 ms
56,064 KB |
testcase_05 | AC | 194 ms
56,692 KB |
testcase_06 | AC | 194 ms
56,800 KB |
testcase_07 | AC | 166 ms
56,180 KB |
testcase_08 | AC | 191 ms
56,688 KB |
testcase_09 | AC | 191 ms
56,784 KB |
testcase_10 | AC | 136 ms
56,208 KB |
ソースコード
import java.io.BufferedInputStream; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.ConcurrentSkipListSet; public class Main { public static final int C = 1000000007; static final int CY = 1000000000; //static boolean MAP[][]; static int N; static int M; static int[][] DIF; static String S; static int K; static int X[][]; //static String S[]; static int HA[]; static long DP[]; static int ST[][]; static ConcurrentSkipListSet<Integer> TS; static ArrayList<Integer> AL; public static void main(String[] args) { StringBuilder sb = new StringBuilder(); BufferedInputStream bs = new BufferedInputStream(System.in); Scanner sc = new Scanner(bs); N = sc.nextInt(); BigInteger ans = new BigInteger("ZZZZZZZZZZZZ", 36); String[] strs = new String[N]; for (int i=0; i < N; i++) { String str = sc.next(); strs[i] = str; int d = 1; for (int t=0; t < str.length(); t++) { d = Math.max(d, str.charAt(t) - '0' +1); } if (d > 10) { d-=7; } BigInteger num = new BigInteger(strs[i], d); ans = ans.min(num); } System.out.println(ans); } }