摘要:
e-KMP专题(1)KMP和e-KMP会用(2) 循环节主要还是要会转换问题,问题的转换是不难的。KMP 求S和T匹配的个数 int nextt[maxn]; void getNext(char T[]) { int len=strlen(T); int i = 1; nextt[1] = 0; i 阅读全文
摘要:
用于求解树上长度为k的路径的数量问题主要就是**找树的重心+容斥思想** 以下是一些题目:luoguP3806模板题求树上长度为k的路径是否存在问题 #include<stdio.h> #include<algorithm> #include<iostream> using namespace st 阅读全文