結果

問題 No.164 ちっちゃくないよ!!
ユーザー ktshunktshun
提出日時 2015-06-08 20:27:07
言語 Python2
(2.7.18)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-04-21 15:25:28
合計ジャッジ時間 683 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
6,400 KB
testcase_01 AC 9 ms
6,272 KB
testcase_02 AC 9 ms
6,400 KB
testcase_03 AC 11 ms
6,400 KB
testcase_04 AC 11 ms
6,400 KB
testcase_05 AC 21 ms
6,272 KB
testcase_06 AC 20 ms
6,400 KB
testcase_07 AC 14 ms
6,400 KB
testcase_08 AC 17 ms
6,400 KB
testcase_09 AC 16 ms
6,400 KB
testcase_10 AC 10 ms
6,272 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