結果

問題 No.164 ちっちゃくないよ!!
ユーザー nebukuro09nebukuro09
提出日時 2016-09-08 10:00:41
言語 Python2
(2.7.18)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 6,520 KB
実行使用メモリ 6,224 KB
最終ジャッジ日時 2023-08-09 23:49:50
合計ジャッジ時間 1,041 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,008 KB
testcase_01 AC 10 ms
6,128 KB
testcase_02 AC 10 ms
6,156 KB
testcase_03 AC 9 ms
6,056 KB
testcase_04 AC 9 ms
6,184 KB
testcase_05 AC 14 ms
6,072 KB
testcase_06 AC 15 ms
6,184 KB
testcase_07 AC 11 ms
6,088 KB
testcase_08 AC 13 ms
6,224 KB
testcase_09 AC 13 ms
6,100 KB
testcase_10 AC 10 ms
6,204 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