結果

問題 No.164 ちっちゃくないよ!!
ユーザー mkawa2mkawa2
提出日時 2019-12-27 22:41:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 556 ms / 2,000 ms
コード長 1,298 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 44,512 KB
最終ジャッジ日時 2024-04-17 22:18:52
合計ジャッジ時間 8,809 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 540 ms
44,388 KB
testcase_01 AC 539 ms
44,392 KB
testcase_02 AC 541 ms
44,384 KB
testcase_03 AC 538 ms
44,380 KB
testcase_04 AC 533 ms
44,388 KB
testcase_05 AC 538 ms
44,260 KB
testcase_06 AC 549 ms
44,512 KB
testcase_07 AC 547 ms
44,380 KB
testcase_08 AC 556 ms
44,252 KB
testcase_09 AC 551 ms
44,252 KB
testcase_10 AC 552 ms
44,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from bisect import *
from math import *
from collections import *
from heapq import *
from random import *
from decimal import *
import numpy as np
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    def ctoa(c):
        code = ord(c)
        if code > 64:
            code -= 55
        else:
            code -= 48
        return code

    n=II()
    ss=[input() for _ in range(n)]
    aa=[]
    for s in ss:
        base = 0
        dd=[]
        for c in s:
            d=ctoa(c)
            dd.append(d)
            if d+1>base:base=d+1
        a=0
        dig=1
        for d in dd[::-1]:
            a += dig * d
            dig *= base
        aa.append(a)
    print(min(aa))

main()
0