随笔分类 -  菜鸡刷题笔记-KMP

摘要:链接: http://acm.hdu.edu.cn/showproblem.php?pid=4763 题意: It's time for music! A lot of popular musicians are invited to join us in the music festival. E 阅读全文
posted @ 2019-09-29 11:20 YDDDD 阅读(128) 评论(0) 推荐(0)
摘要:链接: http://acm.hdu.edu.cn/showproblem.php?pid=4847 题意: Now, Doge wants to know how many words “doge” are there in a given article. Would you like to h 阅读全文
posted @ 2019-09-29 10:49 YDDDD 阅读(183) 评论(0) 推荐(0)
摘要:链接: http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1010&cid=872 题意: 鉴纯夏是一名成绩不太好的高中生。一天她在数学考试中碰到了一道求某条线段长度的问题。因为她并不会做这道题,所以她准确地作图后用尺子量出了这条线 阅读全文
posted @ 2019-09-28 21:08 YDDDD 阅读(297) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/FZU 1901 题意: For each prefix with length P of a given string S,if S[i]=S[i+P] for i in [0..SIZE(S) p 1], then the prefi 阅读全文
posted @ 2019-09-27 16:28 YDDDD 阅读(168) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/HDU 3374 题意: Give you a string with length N, you can generate N strings by left shifts. For example let consider the s 阅读全文
posted @ 2019-09-26 21:24 YDDDD 阅读(121) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/HDU 1238 题意: You are given a number of case sensitive strings of alphabetic characters, find the largest string X, such 阅读全文
posted @ 2019-09-26 20:30 YDDDD 阅读(172) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/HDU 4300 题意: Clairewd is a member of FBI. After several years concealing in BUPT, she intercepted some important messag 阅读全文
posted @ 2019-09-26 19:56 YDDDD 阅读(159) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/HDU 3336 题意: It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a 阅读全文
posted @ 2019-09-26 19:04 YDDDD 阅读(133) 评论(0) 推荐(0)
摘要:链接: https://www.luogu.org/problem/P5410 submit 题意: 有两个字符串aa,bb,要求输出bb与aa的每一个后缀的最长公共前缀 思路: 扩展kmp模板, 上一个大佬的详解链接 https://segmentfault.com/a/1190000008663 阅读全文
posted @ 2019-09-25 23:54 YDDDD 阅读(155) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/HDU 2594 author=0 题意: 求S1的前缀和S2的后缀的《最大》匹配 思路: kmp方法: 将s1, s2首尾连接, 根据Next数组求, 注意长度要比s1, 和s2的长度小. ExtenKmp: 考虑以s1为模板串, 匹配 阅读全文
posted @ 2019-09-25 21:41 YDDDD 阅读(192) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/POJ 3080 author=alexandleo 题意: 给你一些字符串,让你找出最长的公共子串。 思路: 暴力枚举第一个串的子串,挨个匹配接下来的所有串. 找出最长子串中, 字典序最小的. 代码: c++ include inclu 阅读全文
posted @ 2019-09-24 20:56 YDDDD 阅读(315) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/POJ 2752 author=0 题意: 给定若干只含小写字母的字符串(这些字符串总长≤400000),在每个字符串中求出所有既是前缀又是后缀的子串长度。 例如:ababcababababcabab,既是前缀又是后缀的子串:ab,aba 阅读全文
posted @ 2019-09-24 17:06 YDDDD 阅读(172) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/HDU 1358 author=0 题意: For each prefix of a given string S with N characters (each character has an ASCII code between 9 阅读全文
posted @ 2019-09-24 16:35 YDDDD 阅读(132) 评论(0) 推荐(0)
摘要:链接: https://vjudge.net/problem/HDU 3746 题意: 第一题来啦。 现在给你一个字符串,请问在该字符串末尾最少添加多少个字符,可以让这个字符串获得重复循环序列。 思路: 考虑一个用字符串长度为len, 并且是由长度为l的子串循环组成. 我们有S[0,len l 1] 阅读全文
posted @ 2019-09-24 15:48 YDDDD 阅读(108) 评论(0) 推荐(0)
摘要:链接:https://vjudge.net/problem/HDU-1686#author=0 题意: 求模式串在待匹配串的出现次数。 思路: kmp 代码: 阅读全文
posted @ 2019-03-18 15:58 YDDDD 阅读(103) 评论(0) 推荐(0)
摘要:链接:https://vjudge.net/problem/HDU-1711 题意: 给出两个数字序列 : a[1], a[2], ...... , a[N], 和 b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). 你的任 阅读全文
posted @ 2019-03-18 15:38 YDDDD 阅读(126) 评论(0) 推荐(0)
摘要:链接:https://vjudge.net/problem/POJ-2406#author=chen_zhe_ 题意: 给定若干个长度 ≤ 1000000 的字符串,询问每个字符串最多是由多少个相同的子字符串重复连接而成的。如:ababab 则最多有 3 个 ab 连接而成。 思路: 求kmp的ne 阅读全文
posted @ 2019-03-10 22:10 YDDDD 阅读(353) 评论(0) 推荐(0)
摘要:链接:https://vjudge.net/problem/HDU-2087 题意: 一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? 思路: KMP模板,算得时候, 当j移到尾部时,res+1,j置为0, 阅读全文
posted @ 2019-03-10 16:37 YDDDD 阅读(162) 评论(0) 推荐(0)