結果

問題 No.164 ちっちゃくないよ!!
ユーザー yaoshimaxyaoshimax
提出日時 2015-03-25 00:59:32
言語 Python2
(2.7.18)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 508 bytes
コンパイル時間 43 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-04-21 15:23:14
合計ジャッジ時間 820 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N=int(raw_input())

def getNum(c):
    if ord(c) >= ord('0') and ord(c) <= ord('9'):
        return ord(c)-ord('0')
    return ord(c)-ord('A')+10

ans = 1e19

for i in range(N):
    s=raw_input()
    for b in range(2,37):
        tmp=0
        digit=1
        ok = True
        for c in s[::-1]:
            n=getNum(c)
            if n >= b:
                ok=False
                break
            tmp+=digit*n
            digit*=b
        if ok:
            ans=min(ans,tmp)
            break
print ans
0