問題一覧 > 通常問題

No.164 I'm Not Small!!

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 293
作問者 : なお
お気に入りにしたユーザー ProblemId : 317 / 自分の提出
問題文最終更新日: 2026-06-25 12:19:21
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 91 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。