随笔分类 -  知识点

摘要:KMP模板 [题目链接:][48ab497a] c++ include include using namespace std; int kmp(string t, string p) { int ans=0; int plen=p.length(); int next[plen],nextval[ 阅读全文
posted @ 2018-03-10 02:58 lemonsbiscuit 阅读(350) 评论(0) 推荐(0)
摘要:线段树模板 以前写的线段树很丑,看不下去,跟新过一版,还是丑。重新整理一份最新的理解,个人比较舒服,来跟新一下。以区间求和,区间更新为例,参考题目:poj 3468 [题目链接:http://poj.org/problem?id=3468][9b8481d9] 代码: c++ include inc 阅读全文
posted @ 2017-11-25 00:01 lemonsbiscuit 阅读(925) 评论(0) 推荐(0)
摘要:其实我更想把他类比于符号函数,定义域N+,值域{-1,0,1} 定义函数: 根据定义有: 同时容易得出: 现定义公式: 代入到上述f(i)的求取,我们可以得到: 那么其中的μ(d)就是莫比乌斯函数,定义如下: (1)当d=1时,μ(d)=1; (2)当d=p1p2...pk为互异素数,μ(d)=-1 阅读全文
posted @ 2017-11-07 23:23 lemonsbiscuit 阅读(340) 评论(0) 推荐(0)