摘要: https://www.luogu.org/problem/show?pid=2580 字典树trie; 感觉所有树里面字典树最好理解了; 但是操作直接到指针; 这个我调了40min; 感觉和p转c++时差不多,很傻逼的错误调好久; 字典树感觉不用讲什么 还有 a->b==(*a)... 阅读全文
posted @ 2017-03-14 22:56 largecube233 阅读(118) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problem/show?pid=2375 因为有一个限制,我们不能简单的处理; 首先,当i满足限制条件时,对于i+1,我们如果用i的限制条件去更新i+1,那么i+1会有错误; 所以我们要先跑一边无限制的kmp,然后再去求出限制的kmp;... 阅读全文
posted @ 2017-03-14 15:37 largecube233 阅读(155) 评论(0) 推荐(0) 编辑
摘要: https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1277 首先求前缀,那么你要想到kmp; 我们算出next数组(即p[])后,可以理解为包含关系; 即前缀i包含前缀p[i]; 我们搞一个sum[i]表示... 阅读全文
posted @ 2017-03-14 11:31 largecube233 阅读(101) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problem/show?pid=3375 代码:#include#include#include#define Ll long longusing namespace std;string s,ss;int p[1001];int n,... 阅读全文
posted @ 2017-03-14 10:36 largecube233 阅读(190) 评论(0) 推荐(0) 编辑