結果

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

ソースコード

diff #

from collections import deque
S=list(input())

n=len(S)
ans=set()
for i in range(2**n):
    deq=deque(S)
    tmp=''
    for j in range(n):
        if i>>j & 1:
            tmp+=deq.popleft()
        else:
            tmp+=deq.pop()
    ans.add(tmp)
print(len(ans))
0