結果

問題 No.164 ちっちゃくないよ!!
ユーザー 👑 rin204rin204
提出日時 2020-08-06 12:29:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 11,980 KB
実行使用メモリ 10,184 KB
最終ジャッジ日時 2023-10-19 17:07:05
合計ジャッジ時間 1,395 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,176 KB
testcase_01 AC 29 ms
10,176 KB
testcase_02 AC 30 ms
10,176 KB
testcase_03 AC 30 ms
10,176 KB
testcase_04 AC 31 ms
10,176 KB
testcase_05 AC 42 ms
10,184 KB
testcase_06 AC 41 ms
10,184 KB
testcase_07 AC 36 ms
10,180 KB
testcase_08 AC 38 ms
10,184 KB
testcase_09 AC 38 ms
10,184 KB
testcase_10 AC 31 ms
10,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = 10 ** 50

for _ in range(n):
    v = input()
    lst = []
    for num in v:
        if num in "0123456789":
            lst.append(int(num))
        else:
            lst.append(ord(num) - 55)
    
    p = max(max(lst) + 1, 2)
    total = 0

    for i in range(len(lst)):
        total += (p ** i) * lst[-1 - i]
    ans = min(ans, total)
print(ans)
0