結果

問題 No.599 回文かい
ユーザー Bioinfo_KBioinfo_K
提出日時 2017-11-25 01:27:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 291 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 38,656 KB
最終ジャッジ日時 2024-05-05 11:59:29
合計ジャッジ時間 10,818 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 30 ms
10,496 KB
testcase_02 AC 29 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 33 ms
10,624 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 37 ms
10,624 KB
testcase_11 AC 36 ms
10,624 KB
testcase_12 AC 53 ms
10,752 KB
testcase_13 AC 70 ms
10,880 KB
testcase_14 AC 3,822 ms
31,488 KB
testcase_15 AC 251 ms
11,776 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
evil_0.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,collections
mod = 10**9+7
sys.setrecursionlimit(mod)

s= input()
d = collections.defaultdict(lambda: 1)
def DFS(s):
    if s in d:
        return d[s]
    for i in range(1,len(s)//2+1):
        if s[:i] == s[-i:]:
            d[s] += DFS(s[i:-i])
    return d[s]
print(DFS(s)%mod)
0