結果

問題 No.164 ちっちゃくないよ!!
ユーザー lemonlemon
提出日時 2021-05-16 14:18:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 799 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-15 05:54:37
合計ジャッジ時間 1,000 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,880 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 28 ms
10,752 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 34 ms
10,752 KB
testcase_09 WA -
testcase_10 AC 27 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
ntp = lambda: tuple(map(int, stdin.readline().split()))
mod = 10 * 9 + 7
inf = 2 << 60

ans = ''
num = inf

n = ni()

for _ in range(n):
    S = ns()
    T = list(reversed(list(S)))
    m = 0
    mx = 0
    for i in range(len(S)):
        if ord(T[i]) > 57:
            j = ord(T[i]) - 55
        else:
            j = int(T[i])
        m += j * (36 ** i)
        if mx < j:
            mx = j

    if m < num:
        ans = T
        num = m
        ansmx = mx + 1

m = 0
for i in range(len(ans)):
    if ord(ans[i]) > 57:
        j = ord(ans[i]) - 55
    else:
        j = int(ans[i])
    m += j * (ansmx ** i)
print(m)
0