結果

問題 No.164 ちっちゃくないよ!!
ユーザー ゆるくゆるく
提出日時 2015-05-04 04:19:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-21 15:24:09
合計ジャッジ時間 1,051 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 34 ms
10,752 KB
testcase_03 AC 32 ms
10,880 KB
testcase_04 AC 33 ms
10,752 KB
testcase_05 AC 44 ms
10,880 KB
testcase_06 AC 45 ms
10,880 KB
testcase_07 AC 36 ms
10,752 KB
testcase_08 AC 39 ms
10,752 KB
testcase_09 AC 39 ms
11,008 KB
testcase_10 AC 31 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

lm = lambda x: x - 55 if x >= 65 else x - 48
n = int(input())
e = [[int(lm(ord(i))) for i in list(input())] for i in range(n)]

ans = -1
for ee in e:
    num_base = max(ee) + 1
    t = 0
    num = 0
    for ee2 in reversed(ee):
        t += (num_base ** num) * ee2
        num += 1
    ans = min(ans, t) if ans >= 0 else t
print(ans)
0