摘要: LIsa 就是一个背包 #include<cstdio> #include<iostream> #include<cstring> #include<iomanip> #include<cmath> #include<algorithm> #define int long long using na 阅读全文
posted @ 2021-10-12 15:56 Simex 阅读(33) 评论(0) 推荐(0) 编辑
摘要: LIsa 只要理解kmp,就会知道应该找前缀和后缀了 把当前输入的串和已知的答案串拼起来,然后中间加上一个小小的不存在字符,跑kmp #include<cstdio> #include<iostream> #include<cstring> #include<iomanip> #include<cm 阅读全文
posted @ 2021-10-12 15:53 Simex 阅读(22) 评论(0) 推荐(0) 编辑
摘要: Jisoo 枚举一下next也没事 也可以运用结论 这个结论画个图证明就可以了 #include<cstdio> #include<iostream> #include<cstring> #include<iomanip> #include<cmath> #include<algorithm> us 阅读全文
posted @ 2021-10-12 13:58 Simex 阅读(32) 评论(0) 推荐(0) 编辑
摘要: Jisoo kmp中的next数组表示按照当前位置结尾的相同的最大真前缀和后前缀长度 那么如果这玩意真的存在,那么next[n] 一定不为零 然后枚举一下2-n-1,找找有没有相等的next就可以了 #include<cstdio> #include<iostream> #include<cstri 阅读全文
posted @ 2021-10-12 13:53 Simex 阅读(31) 评论(0) 推荐(0) 编辑
摘要: Jisoo 不显然的树上dp 定义$f_{i,j}$为第i位和为子树所选奇数个/偶数个点的方案数 然后显然会发现奇数加奇数等于偶数等规律 然后就可以转移了 #include<cstdio> #include<iostream> #include<cstring> #include<iomanip> 阅读全文
posted @ 2021-10-12 13:42 Simex 阅读(34) 评论(0) 推荐(0) 编辑