結果

問題 No.164 ちっちゃくないよ!!
ユーザー ssmkzkssmkzk
提出日時 2018-08-29 17:20:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 794 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 8,304 KB
最終ジャッジ日時 2023-10-11 20:38:14
合計ジャッジ時間 1,144 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,768 KB
testcase_01 AC 15 ms
7,852 KB
testcase_02 AC 16 ms
7,876 KB
testcase_03 AC 16 ms
7,968 KB
testcase_04 AC 16 ms
7,816 KB
testcase_05 AC 30 ms
8,304 KB
testcase_06 AC 28 ms
8,232 KB
testcase_07 AC 22 ms
7,952 KB
testcase_08 AC 25 ms
8,200 KB
testcase_09 AC 24 ms
8,232 KB
testcase_10 AC 17 ms
7,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
l_ans = []

for i in range(N):
    S = input()
    l = list(S)
    l = [10 if x == "A" else 11 if x == "B" else 12 if x == "C" else 13 if x == "D" else 14 if x == "E" else 15 if x == "F" else 16 if x == "G" else 17 if x == "H" else 18 if x == "I" else 19 if x == "J" else 20 if x == "K" else 21 if x == "L" else 22 if x == "M" else 23 if x == "N" else 24 if x == "O" else 25 if x == "P" else 26 if x == "Q" else 27 if x == "R" else 28 if x == "S" else 29 if x == "T" else 30 if x == "U" else 31 if x == "V" else 32 if x == "W" else 33 if x == "X" else 34 if x == "Y" else 35 if x == "Z" else int(x) for x in l]
    l_max = max(l)
    tei = l_max + 1
    l.reverse()
    ans = 0
    for i in range(len(l)):
        ans += tei ** i * l[i]
    l_ans.append(ans)

print(min(l_ans))
0