No.164 I'm Not Small!!
Problem Statement
$N$ integers, each at least $1$, are given as input.
Output the minimum value among them.
However, the input is not necessarily written in base $10$ notation;
each $1$ given integer is written in some notation between base $2$ notation and base $36$ notation.
You may interpret it in any base as long as the interpretation is valid,
but the value the input intends is the smallest numeric value among the possible interpretations.
Base $16$ notation normally uses the $16$ characters [ 0~9, A~F ] for its digits,
but in this problem this is extended so that base $17$ notation and above additionally use G~Z in order,
and base $36$ notation uses the $36$ characters [ 0~9, A~Z ].
For example, if "YUKICODER" is taken as a number written in base $36$ notation,
its value in base $10$ notation is 98313307106787.
Also note that a given integer may start with 0.
[Reference for those unfamiliar with this (Wikipedia)]
Binary,
Octal,
Hexadecimal,
Positional notation
Input
$N$ $V_1$ $V_2$ $\dots$ $V_N$
Line $1$ contains an integer $N\ (1 \leq N \leq 1000)$, the number of inputs.
The following $N$ lines each contain an integer $V_i\ (1 \leq i \leq N)$.
Each integer $V_i$ is an integer of at least $1$ written in some notation between base $2$ notation and base $36$ notation,
and is a string of at most $12$ characters consisting of digits (0~9) or uppercase letters (A~Z).
Output
Output the minimum value among the given integers in base $10$ notation.
However, the output must not start with 0.
Sample
Sample 1
Input
4 41 32 23 14
Output
9
Sample 2
Input
9 000223444444 00003641077 0001783660 00002DOOO 00052KC0 0064JJJ 0BG938 F423F UGHV
Output
999999
Sample 3
Input
7 YUKICODER TOPCODER ATCODER CODEFORCES CODECHEF AIZUONLINE HACKERRANK
Output
8005080147
Sample 4
Input
1 0XFFFFFFFFFF
Output
69062819408545233
Starting with 0X does not mean that the number is hexadecimal.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。