![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
天夏123
这个作者很懒,什么都没留下…
展开
-
HDOJ-1671 Phone List(Trie树)
一道字典树的题,这道题在检查每个串时,不仅要判断别的串是否为自己的前缀,还要判断自己是否为其他串的前缀.#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <vector>#include <climits>#include <set>#include <cstdlib>u原创 2016-03-18 13:51:29 · 196 阅读 · 0 评论 -
Codeforces Beta Round #93 (Div. 1 Only)-B. Password(KMP)
原题链接B. Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAsterix, Obelix and their t原创 2016-10-21 10:48:57 · 342 阅读 · 0 评论 -
Codeforces Round #246 (Div. 2)-D. Prefixes and Suffixes(KMP+DP)
原题链接D. Prefixes and Suffixestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have a stri原创 2016-10-20 23:09:19 · 263 阅读 · 0 评论 -
Codeforces Round #299 (Div. 2)-D. Tavas and Malekas(kmp)
原题链接D. Tavas and Malekastime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTavas is a strange creature.原创 2016-10-21 13:44:48 · 313 阅读 · 0 评论 -
Codeforces Round #117 (Div. 2)-D. Common Divisors(KMP)
原题链接D. Common Divisorstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has recently learned at原创 2016-10-21 12:20:03 · 344 阅读 · 0 评论 -
Educational Codeforces Round 9-C. The Smallest String Concatenation(字符串排序)
原题链接C. The Smallest String Concatenationtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given原创 2016-08-29 15:30:56 · 337 阅读 · 0 评论 -
ZZULIOJ-1961 斗破苍穹(马拉车算法)
#include <cstring>#include <cstdio>#include <algorithm>#include <iostream>#include <queue>#define maxn 100005using namespace std;char str[maxn], ch[maxn<<1];int len[maxn<<1];void Init(){ int j原创 2016-04-14 10:23:45 · 899 阅读 · 0 评论 -
HDOJ-2594 Simpsons’ Hidden Talents(KMP)
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <vector>#include <string>using namespace std;#define maxn 50005int next1[maxn<<1];void KMP(string &s){ ne原创 2016-03-13 20:02:49 · 223 阅读 · 0 评论 -
POJ-2406 Power Strings(KMP)
#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>using namespace std;#define maxn 1000005char ch[maxn];int next[maxn];void kmp(char *ch, int len){ next[0] = -1; i原创 2016-03-08 21:03:29 · 168 阅读 · 0 评论 -
POJ-2752 Seek the Name, Seek the Fame
一道简单的KMP算法的题,只要了解KMP的原理就能解出来#include <iostream>#include <cstdio>#include <algorithm>using namespace std;#define maxn 400005int next[maxn];int ans[maxn];void kmp(string &s){ next[0] = -1; i原创 2016-03-08 19:53:40 · 165 阅读 · 0 评论 -
51nod-1277 字符串中的最大值(KMP)
原题链接1277 字符串中的最大值题目来源: Codility基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注一个字符串的前缀是指包含该字符第一个字母的连续子串,例如:abcd的所有前缀为a, ab, abc, abcd。给出一个字符串S,求其所有前缀中,字符长度与原创 2017-01-09 00:31:37 · 615 阅读 · 0 评论