結果
| 問題 | 
                            No.52 よくある文字列の問題
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-09-03 22:32:37 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 35 ms / 5,000 ms | 
| コード長 | 372 bytes | 
| コンパイル時間 | 183 ms | 
| コンパイル使用メモリ | 12,288 KB | 
| 実行使用メモリ | 10,496 KB | 
| 最終ジャッジ日時 | 2024-12-24 20:33:39 | 
| 合計ジャッジ時間 | 1,238 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 11 | 
ソースコード
# 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 dfs(s, t):
#    print(s, t)
    if len(s) == 0:
        ptn.add(t)
        return
    dfs(s[1:], t+s[0])
    dfs(s[0:-1], t+s[-1])
    return
dfs(S, '')
print(len(ptn))