摘要: // hdu 3065 AC自动机//// 题目大意://// 给你n个短串,然后给你一个长串,问:各个短串在长串中,出现了多少次//// 解题思路://// AC自动机,插入,构建,查询就OK啦//// 感悟://// 这道题真的是... 阅读全文
posted @ 2015-08-04 22:59 KingJourney 阅读(177) 评论(0) 推荐(0)
摘要: // hdu 2896 AC自动机//// 题目大意:// // 给你n个短串,然后给你q串长字符串,要求每个长字符串中// 是否出现短串,出现的短串各是什么//// 解题思路:// // AC自动机,插入单词,构建自动机,然后查询就可以了。//// 感悟://// 哎,自己AC自动机果然... 阅读全文
posted @ 2015-08-04 22:21 KingJourney 阅读(155) 评论(0) 推荐(0)
摘要: #include #include #include #include using namespace std;int a,b,c;int exgcd(int a,int b,int &x,int &y){ if (b==0){ x = 1; y = 0; ... 阅读全文
posted @ 2015-08-04 17:03 KingJourney 阅读(148) 评论(0) 推荐(0)
摘要: // poj 1061 青蛙的约会 拓展欧几里得模板// 注意进行exgcd时,保证a,b是正数,最后的答案如果是负数,要加上一个膜#include #include #include #include #include using namespace std;typedef long long l... 阅读全文
posted @ 2015-08-04 15:54 KingJourney 阅读(282) 评论(0) 推荐(0)