結果
問題 |
No.52 よくある文字列の問題
|
ユーザー |
![]() |
提出日時 | 2015-09-21 23:08:25 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 351 bytes |
コンパイル時間 | 79 ms |
コンパイル使用メモリ | 6,784 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 08:29:50 |
合計ジャッジ時間 | 793 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 1 |
ソースコード
def dfs(strSet,S,start,end,nowStr): if start == end:return nowStr strSet.add(S[start] + dfs(strSet,S,start + 1,end, S[start] + nowStr)) strSet.add(S[end] + dfs(strSet,S,start,end - 1,S[end] + nowStr)) return nowStr S = raw_input() strSet = set([]) dfs(strSet,S,0,len(S) - 1,'') count = 0 for i in strSet: if len(i) == len(S):count+= 1 print count