結果

問題 No.164 ちっちゃくないよ!!
ユーザー rlangevinrlangevin
提出日時 2023-01-08 21:54:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 505 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 78,356 KB
最終ジャッジ日時 2023-08-22 06:39:16
合計ジャッジ時間 2,428 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,256 KB
testcase_01 AC 70 ms
71,312 KB
testcase_02 AC 69 ms
71,500 KB
testcase_03 AC 70 ms
71,496 KB
testcase_04 AC 71 ms
71,528 KB
testcase_05 AC 107 ms
78,356 KB
testcase_06 AC 96 ms
77,108 KB
testcase_07 AC 91 ms
77,092 KB
testcase_08 AC 97 ms
76,776 KB
testcase_09 AC 98 ms
77,228 KB
testcase_10 AC 73 ms
71,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x):
    if 0 <= ord(x) - ord("0") <= 9:
        return ord(x) - ord("0")
    return ord(x) - ord("A") + 10

N = int(input())
ans = 10 ** 25
for _ in range(N):
    V = list(input())
    V = list(map(f, V))
    maxv = max(V) + 1
    V.reverse()
    c = 1
    val = 0
    for v in V:
        val += c * v
        c *= maxv
    ans = min(ans, val)
print(ans)
0