結果

問題 No.164 ちっちゃくないよ!!
ユーザー koyoprokoyopro
提出日時 2015-09-20 11:52:50
言語 Python2
(2.7.18)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-04-21 15:27:22
合計ジャッジ時間 750 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
6,144 KB
testcase_01 AC 8 ms
6,144 KB
testcase_02 AC 9 ms
6,272 KB
testcase_03 AC 10 ms
6,144 KB
testcase_04 AC 11 ms
6,272 KB
testcase_05 AC 55 ms
6,272 KB
testcase_06 AC 44 ms
6,144 KB
testcase_07 AC 24 ms
6,144 KB
testcase_08 AC 30 ms
6,144 KB
testcase_09 AC 31 ms
6,144 KB
testcase_10 AC 11 ms
6,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

N, = map(int, raw_input().split())

ret = 36 ** 13
for i in xrange(N):
    V, = map(str, raw_input().split())
    maxs = 0
    for v in V:
        try:
            num = int(v)
        except ValueError:
            num = ord(v) - ord('A') + 10
        maxs = max(maxs, num)
    # (maxs+1)進数として扱う
    total = 0
    for i, v in enumerate(V[::-1]):
        try:
            num = int(v)
        except ValueError:
            num = ord(v) - ord('A') + 10
        total += num * (maxs+1) ** i
    ret = min(ret, total)

print ret
0