結果

問題 No.52 よくある文字列の問題
ユーザー Hitoshi Hayakawa
提出日時 2019-09-03 22:31:21
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 372 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-12-24 20:30:05
合計ジャッジ時間 1,202 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

# http://chiwawa-star.hatenablog.com/entry/2017/07/12/194636

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################


S = input().rstrip()

ptn = set()

def bfs(s, t):
#    print(s, t)
    if len(s) == 0:
        ptn.add(t)
        return

    bfs(s[1:], t+s[0])
    bfs(s[0:-1], t+s[-1])
    return

bfs(S, '')
print(len(ptn))
0