
字符串
文章平均质量分 78
zhenggy_
爱生活,爱编程
展开
-
病毒侵袭
#include #include #include using namespace std;int total;char ch[10010];struct trie{ int next[500*201][128], fail[500*201], end[500*201], root, l; int newnode() { for(int i原创 2015-03-14 15:37:21 · 614 阅读 · 0 评论 -
HDU 3746 Cyclic Nacklace //深刻理解next数组
Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2599 Accepted Submission(s): 1174Problem DescriptionCC always原创 2014-07-22 20:04:17 · 582 阅读 · 0 评论 -
HDU 1711 Number Sequence //简单kmp
Number SequenceTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10570 Accepted Submission(s): 4813Problem DescriptionGiven tw原创 2014-07-22 15:37:26 · 648 阅读 · 0 评论 -
UVaOJ 401 - Palindromes
Palindromes A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is原创 2014-05-28 09:54:54 · 795 阅读 · 0 评论 -
KMP模板
#include void getnext(char *ch, int next[]);int kmp(char *ch1, char *ch2, int next[]);int main(){ char ch1[100], ch2[100]; int next[100]; scanf("%s", ch1); getnext(ch1, next);//获得next数组。原创 2014-07-21 10:21:25 · 826 阅读 · 0 评论 -
POJ 1972 Parallelogram Counting
Parallelogram CountingTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 5799 Accepted: 1955DescriptionThere are n distinct points in the plane, given by t原创 2014-07-19 19:08:47 · 778 阅读 · 0 评论 -
POJ 3461 Oulipo 深刻理解KMP算法next数组含义
OulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 22537 Accepted: 8989DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La d原创 2014-07-21 11:30:36 · 886 阅读 · 0 评论 -
Palindromes //简单字符串
#include #include int main(){ int i, mid, len; char stdc[50]= {'A',0,0,0,'3',0,0,'H','I','L',0,'J','M',0,'O',0,0,0,'2','T','U','V','W','X','Y','5','1','S','E',0,'Z',0,0,'8',0}; char c原创 2014-12-05 17:29:46 · 666 阅读 · 0 评论 -
7.2.4 下一个排列
#include #include using namespace std;int main(){ int a[100], i, n; while( scanf("%d", &n)!=-1 ) { for(i=0; i<n; i++) scanf("%d", &a[i]); sort(a, a+n);原创 2014-12-07 17:46:39 · 479 阅读 · 0 评论 -
病毒侵袭持续中
#include #include #include using namespace std;#define M 1000*55typedef struct name{ char v[55]; int num;}name;name virus[1100];char buf[2000010];struct trie{ int next[M][26]原创 2015-03-14 15:37:49 · 511 阅读 · 0 评论 -
Keywords Search
#include #include #include using namespace std;#define M 500010struct trie{ int next[M][26], fail[M], end[M]; int root, l; int newnode() { for(int i=0; i<26; i++) next[原创 2015-03-14 15:38:03 · 531 阅读 · 0 评论 -
最长公共子序列 空间优化最长公共子序列
import java.util.Scanner;/** * HDU 1159 * @author ashzheng * 2016年3月17日17:48:29 */public class LongestCommonSubsequence { public static void main(String[] args) { Scanner scan = new Scanner原创 2016-03-17 17:52:36 · 1285 阅读 · 0 评论