摘要: "题目链接" 容斥+隔板法+Lucas定理 cpp include using namespace std; const int N=1e5+10; int n,m,t,mod,ans; int fc[N],fv[N],b[15]; int lucas(int n,int m) { if(mn) r 阅读全文
posted @ 2019-06-15 17:32 nosta 阅读(141) 评论(0) 推荐(0) 编辑
摘要: "题目链接" 显然一定存在最优解满足编号小的节点深度越深,即从小到大的优先选择(叶节点|除自己以外子树节点都已经被标号)的节点标号(影响最小),存在取法(顺序)得到最优解。 因此考虑对叶节点状压,转移过程中需要计算出当前已经被直接或间接地确定的节点的数量c作为下一个叶节点的编号。复杂度O((n+n) 阅读全文
posted @ 2019-06-15 13:22 nosta 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 关于匹配串T在模式串中出现的位置不一定按顺序……只需要保证位置差不过k。 于是……FFT板题 阅读全文
posted @ 2019-06-15 10:11 nosta 阅读(213) 评论(0) 推荐(0) 编辑