
KMP
文章平均质量分 71
cloudy_happy
像我这样优秀的人,不该平凡过一生
展开
-
hdu2087 剪花布条 KMP
剪花布条 一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。 ...原创 2018-08-18 23:37:24 · 130 阅读 · 0 评论 -
hdu1711 Number Sequence KMP
Number Sequence Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which ma...原创 2018-08-18 23:26:40 · 170 阅读 · 0 评论 -
poj1961 && hdu1358 Period KMP
Period For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for...原创 2018-08-18 23:44:36 · 158 阅读 · 0 评论 -
poj2405 Power Strings KMP
Power Strings Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, expone...原创 2018-08-18 23:48:39 · 173 阅读 · 0 评论 -
hdu3476Cyclic Nacklace KMP
Cyclic Nacklace CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and t...原创 2018-08-19 00:29:57 · 195 阅读 · 0 评论 -
hdu1686 || poj3461 Oulipo
OulipoTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 49925 Accepte...原创 2018-10-16 16:00:23 · 125 阅读 · 0 评论 -
2019杭电多校Day5 1006
思路:扩展kmp,预处理出nxt数组相加,对于全部匹配的前缀减1就行了代码:#include<bits/stdc++.h>using namespace std;#define ll long longconst int maxn = 1e6 + 10;ll nxt[maxn],ans;void getnext(string t){ memset(nx...原创 2019-08-05 20:41:39 · 130 阅读 · 0 评论