結果

問題 No.164 ちっちゃくないよ!!
ユーザー nebukuro09nebukuro09
提出日時 2016-09-08 10:00:41
言語 Python2
(2.7.18)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 17:56:52
合計ジャッジ時間 924 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
6,812 KB
testcase_01 AC 12 ms
6,944 KB
testcase_02 AC 10 ms
6,944 KB
testcase_03 AC 10 ms
6,940 KB
testcase_04 AC 9 ms
6,940 KB
testcase_05 AC 14 ms
6,940 KB
testcase_06 AC 15 ms
6,944 KB
testcase_07 AC 12 ms
6,944 KB
testcase_08 AC 13 ms
6,940 KB
testcase_09 AC 12 ms
6,944 KB
testcase_10 AC 9 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
a = ord('A') - 10
def f(s):
    d = max(s)
    d = int(d)+1 if d.isdigit() else ord(d)-a+1
    x = 0
    for i, c in enumerate(s[::-1]):
        x += int(c)*(d**i) if c.isdigit() else (ord(c)-a)*(d**i)
    return x
print min(map(f, [raw_input() for _ in xrange(N)]))
0