結果

問題 No.164 ちっちゃくないよ!!
ユーザー ktshunktshun
提出日時 2015-06-08 20:27:07
言語 Python2
(2.7.18)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 6,552 KB
実行使用メモリ 6,196 KB
最終ジャッジ日時 2023-08-03 17:11:17
合計ジャッジ時間 1,010 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,196 KB
testcase_01 AC 11 ms
6,064 KB
testcase_02 AC 12 ms
6,192 KB
testcase_03 AC 11 ms
5,996 KB
testcase_04 AC 11 ms
6,072 KB
testcase_05 AC 22 ms
6,008 KB
testcase_06 AC 20 ms
6,012 KB
testcase_07 AC 14 ms
5,964 KB
testcase_08 AC 17 ms
6,044 KB
testcase_09 AC 17 ms
5,960 KB
testcase_10 AC 11 ms
6,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- 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