結果

問題 No.52 よくある文字列の問題
ユーザー Meso Meso
提出日時 2024-09-03 10:14:40
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 36 ms / 5,000 ms
コード長 351 bytes
コンパイル時間 513 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-03 10:14:42
合計ジャッジ時間 1,809 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

S = list(input())

ans = set()

for i in product((0, 1), repeat=len(S)):
    tmp = []
    l, r = 0, len(S) - 1
    for j in i:
        if j:
            tmp.append(S[l])
            l += 1
        else:
            tmp.append(S[r])
            r -= 1
            
    ans.add("".join(map(str, tmp)))
    
print(len(ans))
0