摘要: 回文自动机 参考: 回文树 // Created by CAD #include <bits/stdc++.h> #define ll long long using namespace std; const int maxn=3e5+5; namespace pam{ int sz,tot,las 阅读全文
posted @ 2020-07-29 16:22 caoanda 阅读(107) 评论(0) 推荐(0) 编辑
摘要: P3649 [APIO2014]回文串 根据后缀链接,形成的回文树,对于每一个节点,其子树大小(包括该节点)即为该回文串的出现次数。 // Created by CAD #include <bits/stdc++.h> #define ll long long using namespace std 阅读全文
posted @ 2020-07-29 16:10 caoanda 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Fibonacci Sum 利用斐波那契通项求和,并二项式展开即可。其中求斐波那契需要用到二次剩余求根号5的值。 // Created by CAD #include <bits/stdc++.h> #define ll long long using namespace std; const in 阅读全文
posted @ 2020-07-29 10:33 caoanda 阅读(160) 评论(0) 推荐(0) 编辑