結果
問題 | No.52 よくある文字列の問題 |
ユーザー |
![]() |
提出日時 | 2015-11-11 17:42:17 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 12 ms / 5,000 ms |
コード長 | 322 bytes |
コンパイル時間 | 56 ms |
コンパイル使用メモリ | 6,940 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 05:23:40 |
合計ジャッジ時間 | 694 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
#!/usr/bin/python # -*- coding: utf-8 -*- S = list(raw_input()) L = len(S) strings = set([]) def dfs(S, string, n): if n == L: strings.add(string) return False if dfs(S[1:], string+S[0], n+1): return if dfs(S[:-1], string+S[-1], n+1): return dfs(S, '', 0) print len(strings)