![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
思考熊
这个作者很懒,什么都没留下…
展开
-
CodeForces - 614B Gena's Code
It's the year 4527 and the tanks game that we all know and love still exists. There also exists Great Gena's code, written in 2016. The problem this code solves is: given the number of tanks that go原创 2016-01-22 19:01:48 · 475 阅读 · 0 评论 -
HDU 5510 Bazinga(2015亚洲区沈阳站现场赛)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5510 找到一个最大i,使得前面的字符串有一个不是他的子串。 ——队友告诉我strstr能过,不知为何用kmp T了两发……又好几天不写了…….#include <cstdio> #include <cstring> #include <cmath> #include <ctime> #includ原创 2016-09-26 20:30:29 · 456 阅读 · 0 评论 -
HihoCoder 1258(2015 Asia Beijing Regional Contest)
#include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> using namespace std; int main() { int n,m,k; char s[102]; while(~scanf("%d",&n)) { int ans=0;原创 2016-10-09 19:45:02 · 425 阅读 · 0 评论 -
简单.STL
题目大意:给出母串,有n个字串,乱序后重新排列并输出。 解题思路:用map。#include<iostream> #include<sstream> #include<algorithm> #include<cstdio> #include<string.h> #include<cctype> #include<string> #include<cmath> #include<vector> #i原创 2016-03-14 20:34:27 · 266 阅读 · 0 评论 -
AC自动机
// 有next数组版本。。 #include<cstdio> #include<string.h> #include<math.h> #include<queue> #include<algorithm> #define N 500006 using namespace std; char st[1000005]; char keyword[55]; int n,m; int next[N][26原创 2016-03-14 20:33:18 · 218 阅读 · 0 评论 -
后缀数组 Poj---1743 : Musical Theme
题意:有N(1 <= N <=20000)个音符的序列来表示一首乐曲,每个音符都是1..88范围内的整数,现在要找一个重复的主题。“主题”是整个音符序列的一个子串,它需要满足如下条件: 1.长度至少为5个音符。 2.在乐曲中重复出现。(可能经过转调,“转调”的意思是主题序列中每个音符都被加上或减去了同一个整数值) 3.重复出现的同一主题不能有公共部分。#include<cstdio> #inc原创 2016-03-14 20:31:53 · 379 阅读 · 0 评论 -
字典树 详解 模板代码 加典型习题
1.核心代码 void createTrie(char *str) //生成字典树 { int len = strlen(str); Trie *p = root, *q; for(int i=0; i { int id = str[i]-'0'; if(p->next[id] == NULL原创 2016-03-14 20:21:07 · 305 阅读 · 0 评论 -
kmp算法大全,历史详解
三种next数组推导: (1)Poj-2752 前边字串等于最后字串 #include #include #include using namespace std; int next[500000],a[500000]; char p[500000]; int i,j,k,len,t; void naxt(int *next) { int i,j,k;原创 2016-03-14 20:17:32 · 515 阅读 · 0 评论 -
自反串
#include #include #include #include using namespace std; int main() { int n,m,k; char str[10002]; char st; k=1; while(cin>>str) { if(!strcmp(str,"STOP"))原创 2016-03-19 16:30:36 · 355 阅读 · 0 评论 -
HDU 1062 Text Reverse(字符串翻转)
Text Reverse Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24589 Accepted Submission(s): 9478Problem Description Ignatius likes to write原创 2016-03-22 23:11:38 · 414 阅读 · 0 评论