結果

問題 No.164 ちっちゃくないよ!!
ユーザー pluto77pluto77
提出日時 2016-02-19 19:17:22
言語 Python2
(2.7.18)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 850 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-04-22 14:22:16
合計ジャッジ時間 1,479 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,272 KB
testcase_01 AC 12 ms
6,144 KB
testcase_02 AC 11 ms
6,016 KB
testcase_03 AC 11 ms
6,144 KB
testcase_04 AC 12 ms
6,144 KB
testcase_05 AC 96 ms
6,016 KB
testcase_06 AC 84 ms
6,144 KB
testcase_07 AC 43 ms
6,272 KB
testcase_08 AC 48 ms
6,144 KB
testcase_09 AC 47 ms
6,272 KB
testcase_10 AC 15 ms
6,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
#yuki_164

import sys

def base_convert(nl, ibase, obase):
    o = []
    while any(nl):
        c = 0
        for i in xrange(len(nl)):
            c = c * ibase + nl[i]
            nl[i],c = divmod(c,obase)
        o.append(c)
    o.reverse()
    return o

def radix(lst):
 rdx=0
 for i in xrange(len(lst)):
  order=ord(lst[i])
  if order>=48 and order<=57:
   tmp=order-47
   if tmp>rdx:
    rdx=tmp
  elif order>=65 and order<=90:
   tmp=order-54
   if tmp>rdx:
    rdx=tmp
 return rdx

n=int(raw_input())
res=sys.maxint
for i in xrange(n):
 s=raw_input()
 ls=map(str,s)
 ls2=[]
 for i in xrange(len(ls)):
  if s[i].isalpha()==False:
   ls2.append(int(s[i]))
  elif s[i].isalpha()==True:
   ls2.append(ord(s[i])-55)
 rdx=radix(ls)
 ls3=base_convert(ls2,rdx,10)
 rest=int("".join(map(str,ls3)))
 if rest<res:
  res=rest

print res
0