結果
問題 |
No.599 回文かい
|
ユーザー |
![]() |
提出日時 | 2017-11-25 00:45:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 330 bytes |
コンパイル時間 | 134 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 43,904 KB |
最終ジャッジ日時 | 2024-11-27 08:56:46 |
合計ジャッジ時間 | 17,094 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 17 TLE * 2 |
ソースコード
import sys,collections sys.setrecursionlimit(10**7) mod = 10**9+7 s= input() d = collections.defaultdict(lambda: 0) def DFS(s,n): 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],n)%mod d[s] += 1 return 1 n = 1 ans = DFS(s,n) print(d[s]+1)