摘要: Aimee 马拉车算法,以优秀复杂度求解回文子串 我认为的关键:减少重复计算 用r表示当前已知回文子串右边界,id表示其中心的位置 显然我们当下求解的i应该再id右边 如果这个i在r的左边,那么显然在id的中心中,因该有一个关于i的对称点,并且因为位置的的原因,左边点的回文是已经被算出来了的,那样可 阅读全文
posted @ 2021-02-02 17:13 Simex 阅读(55) 评论(0) 推荐(0)
摘要: #include #include #include #include using namespace std; int c[5]; int n,m; int a[10001]; int x; int dp[41][41][41][41]; int find(int i,int j,int k,in 阅读全文
posted @ 2021-02-02 11:14 Simex 阅读(119) 评论(0) 推荐(0)
摘要: Aimee 想出状态转移的难度很小 很强的题解 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> using namespace std; const int maxn= 阅读全文
posted @ 2021-02-02 10:18 Simex 阅读(77) 评论(0) 推荐(0)