字符串
zoro_n
我想走得更远
展开
-
poj 2503 Babelfish
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.原创 2016-07-27 17:08:47 · 152 阅读 · 0 评论 -
hdu 5763 Another Meaning
Problem DescriptionAs is known to all, in many cases, a word has two meanings. Such as “hehe”, which not only means “hehe”, but also means “excuse me”. Today, ?? is chating with MeiZi online, MeiZ原创 2016-08-04 10:01:19 · 272 阅读 · 0 评论 -
玲珑oj 萌萌哒的第五题
点击打开链接题意:长度为n的串中,子串没有st串的个数。题解:对st串先做一次kmp;然后再做ss[i][j] 表示前i-1个字符与st串前i-1个相同。而第i个表示j和st串前缀的最大匹配数。dp[i][j]表示,长度为i的串中 不存在子串st,并且和子串能够匹配的前缀最长为j。#include #include #include #原创 2017-03-10 21:28:34 · 240 阅读 · 0 评论 -
【转】cf 825F - 19 String Compression 【kmp+dp】
@bin_gege点击打开链接题意: 给你一个长度为8000的字符串,让你压缩,输出压缩后的长度, 例如 ababcababc 压缩后 ab2c1ab2c1. 长度为10 aaaaaaaaaa 压缩后 a10 len=3题解:转载 2017-07-20 17:14:30 · 262 阅读 · 0 评论 -
HDU 5510 Bazinga 【kmp】
点击打开链接题意: 给你n个串。问你满足一个串不完全包含前面的所有串的串的编号最大的串的编号是多少。题解:那就暴力匹配,从前往后枚举每个串,然后对于每个串,再从后往前挨个匹配。如果包含前面的串,就直接覆盖,这样原串长度都不会很长,另外匹配时候用kmp。#include #define ll long longu原创 2017-07-07 22:36:34 · 311 阅读 · 0 评论 -
bzoj 3670 [Noi2014]动物园【kmp】
点击打开链接Time Limit: 10 Sec Memory Limit: 512 MBSubmit: 2866 Solved: 1545[Submit][Status][Discuss]Description近日,园长发现动物园中好吃懒做的动物越来越多了。例如企鹅,只会卖萌向游客要吃的。为了整治动物园的不良风气,让动物们凭自己的真才实学向原创 2017-08-11 23:11:58 · 214 阅读 · 0 评论