
字符串
文章平均质量分 83
even_bao
这个作者很懒,什么都没留下…
展开
-
【Educational Codeforces Round 38 (Rated for Div. 2)】 Problem A-D 题解
【比赛链接】 点击打开链接【题解】Problem A Word Correction【字符串】不用多说了吧,字符串的基本操作Problem B Run for your prize【贪心】我们可以将这个数轴一分为二,小于等于500000的由第一个人领,否则由第二个人领Problem C Constructing tests【贪心】【数学】首先我们发现 : N^2 - (N /...原创 2018-02-19 18:37:55 · 249 阅读 · 0 评论 -
【POJ 3461】 Oulipo
【题目链接】 点击打开链接【算法】 KMP【代码】 #include <algorithm>#include <bitset>#include <cctype>#include <cerrno>#include <clocale>#include <cmath...原创 2018-04-21 11:41:03 · 120 阅读 · 0 评论 -
【POJ 2752】 Seek the Name, Seek the Fame
【题目链接】 点击打开链接【算法】 KMP 沿着失配指针扫一遍即可【代码】 #include <algorithm>#include <bitset>#include <cctype>#include <cerrno>#include <clocale>#in...原创 2018-04-21 10:52:58 · 119 阅读 · 0 评论 -
【POJ 1961】 Period
【题目链接】 点击打开链接【算法】 KMP 和POJ2406很像【代码】 #include <algorithm>#include <bitset>#include <cctype>#include <cerrno>#include <clocale>#i...原创 2018-04-21 10:39:35 · 226 阅读 · 0 评论 -
【POJ 2406】 Power Strings
【题目链接】 点击打开链接【算法】 KMP 如果字符串中存在循环节,则next[len] = (循环节个数 - 1) * 循环节长度 循环节个数 = len / (len - next[len]) 【代码】 #include...原创 2018-04-21 10:08:47 · 228 阅读 · 0 评论 -
【CAIOJ1177】 子串是否出现
【题目链接】 点击打开链接【算法】 KMP【代码】 #include<bits/stdc++.h>using namespace std;#define MAXA 1000010#define MAXB 1010int i,j,lenA,lenB;int p[MAXB];char SA[MAXA],SB[MAXB]...原创 2018-04-20 20:11:29 · 124 阅读 · 0 评论 -
【CAIOJ 1178】 最长共同前缀长度
【题目链接】 点击打开链接【算法】 EXKMP【代码】 #include<bits/stdc++.h>using namespace std;#define MAXL 1000010int i,N,l1,l2;char s1[MAXL],s2[MAXL];int extend[MAXL],next[MAXL];...原创 2018-04-20 19:00:00 · 257 阅读 · 0 评论 -
【TJOI2013】 单词
【题目链接】 点击打开链接【算法】 AC自动机+递推【代码】 #include<bits/stdc++.h>using namespace std;#define MAXN 200const int MAXL = 1e6+5;int i,N;int pos[MAXN+10];char s[MAXN+1][MAXL];temp...原创 2018-02-19 17:38:19 · 259 阅读 · 0 评论 -
【hdu 2222】Keywords Search
【题目链接】 点击打开链接【算法】 此题是AC自动机模板题 AC自动机是很神奇的算法,简单点来说,就是在一棵字典树上进行KMP,它的应用范围很广,非常实用 这篇博客写得很好,推荐阅读 : http://blog.youkuaiyun.com/creatorx/article/details/71100840【代码】 个人觉得我的代码还是写得不错...原创 2018-02-11 23:13:18 · 195 阅读 · 0 评论 -
【HDU 3613】Best Reward
【题目链接】 点击打开链接【算法】 正反两遍EXKMP,即可【代码】 #include<bits/stdc++.h>using namespace std;#define MAXC 26#define MAXL 500010int T,ans,tmp,i,len;int a[MAXC+1],Next[MAXL],exte...原创 2018-04-21 17:08:08 · 325 阅读 · 0 评论