結果

問題 No.164 ちっちゃくないよ!!
ユーザー tktk_snsn
提出日時 2021-03-20 15:33:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-21 02:19:14
合計ジャッジ時間 1,122 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

from string import ascii_uppercase, digits
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
inf = 10**20

char = digits+ascii_uppercase
stoi = {s: i for i, s in enumerate(char)}


def convert(S, d):
    res = 0
    for s in S:
        res = d * res + stoi[s]
    return res


N = int(input())
V = [input().rstrip() for _ in range(N)]

ans = inf
for v in V:
    vmax = max(v)
    for i, c in enumerate(char[1:], 2):
        if vmax <= c:
            ans = min(ans, convert(v, i))

print(ans)
0