結果
問題 |
No.164 ちっちゃくないよ!!
|
ユーザー |
|
提出日時 | 2015-06-08 20:27:07 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 520 bytes |
コンパイル時間 | 48 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-10-13 14:15:53 |
合計ジャッジ時間 | 694 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
# -*- 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