結果
問題 | No.52 よくある文字列の問題 |
ユーザー | tookunn_1213 |
提出日時 | 2015-09-21 23:08:25 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 351 bytes |
コンパイル時間 | 705 ms |
コンパイル使用メモリ | 6,568 KB |
実行使用メモリ | 6,096 KB |
最終ジャッジ日時 | 2023-09-26 14:14:51 |
合計ジャッジ時間 | 1,600 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 11 ms
5,904 KB |
testcase_01 | AC | 11 ms
5,856 KB |
testcase_02 | AC | 12 ms
5,928 KB |
testcase_03 | AC | 11 ms
6,084 KB |
testcase_04 | AC | 12 ms
6,096 KB |
testcase_05 | AC | 12 ms
6,076 KB |
testcase_06 | AC | 13 ms
5,960 KB |
testcase_07 | AC | 11 ms
6,096 KB |
testcase_08 | AC | 12 ms
5,940 KB |
testcase_09 | WA | - |
testcase_10 | AC | 11 ms
5,940 KB |
ソースコード
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