結果

問題 No.164 ちっちゃくないよ!!
コンテスト
ユーザー ktshun
提出日時 2015-06-08 20:27:07
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 77,596 KB
最終ジャッジ日時 2025-12-03 15:33:45
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# -*- coding:utf-8 -*-
def solve():
	global check
	s = raw_input()
	s2 = list(s)
	s2.sort()
	mx = s2[::-1][0]
	mx = check.index(mx)
	if mx < 2:
		mx = 2
	else:
		mx += 1
	num = 0
	nums = 1
	for i in s[::-1]:
		temp = check.index(i)
		num += temp * nums
		nums *= mx
	return num



if __name__ == "__main__":
	nums = map(str,xrange(10))
	alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	alpha = list(alpha)
	check = nums + alpha
	n = input()
	ans = float("INF")
	for i in xrange(n):
		temp = solve()
		ans = min(temp,ans)
	print ans
0