結果

問題 No.164 ちっちゃくないよ!!
コンテスト
ユーザー cologne
提出日時 2025-12-12 18:54:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 819 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 304 ms
コンパイル使用メモリ 82,708 KB
実行使用メモリ 79,240 KB
最終ジャッジ日時 2025-12-12 18:54:35
合計ジャッジ時間 2,046 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import string
import sys
from typing import Generator, List, Tuple


def input(): return sys.stdin.readline().rstrip('\n')


def cvt(x, b):
    a = 0
    for i in x:
        a = a * b + ((string.digits + string.ascii_uppercase)[:b]).index(i)
    return a


def main():
    n = int(input())
    a = []
    for _ in range(n):
        k = input()
        for d in range(2, 37):
            try:
                a.append(cvt(k, d))
            except ValueError:
                pass
    return min(a)


if __name__ == '__main__':
    ret = main()


    def out(x):
        if isinstance(x, List) or isinstance(x, Tuple):
            print(*x)
        else:
            print(x)


    if ret is None:
        pass
    elif isinstance(ret, Generator):
        for val in ret:
            out(val)
    else:
        out(ret)
0