POJ 1961 Period(KMP)】的更多相关文章

http://poj.org/problem?id=1961 题意 :给你一个字符串,让你输出到第几个字符时,循环结的个数. 思路 :这个题和2409差不多,稍微修改一下,加一个循环就行了,用的也是KMP. #include <string.h> #include <stdio.h> #include <iostream> using namespace std ; ; char ch[maxn] ; int next[maxn] ; int main() { int…
题意:给定一个长度为n字符串s,求它每个前缀的最短循环节.也就是对于每个i(2<=i<=n),求一个最大整数k>1(如果存在),使得s的前i个字符组成的前缀是某个字符串重复得k次得到的.输出所有的的k和i. 析:首先这是一个KMP的一个题(据大神们说这是一个水题...),首先要对KMP有了解,如果没有了解的先看一下,提供一个地址学习KMP算法, http://www.cnblogs.com/dwtfukgv/articles/5532277.html 对KMP有所了解后,其实这就是一个对…
Period Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 11356   Accepted: 5279 Description 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…
关于KMP的最短循环节.循环周期,请戳: http://www.cnblogs.com/chenxiwenruo/p/3546457.html (KMP模板,最小循环节) POJ 2406  Power Strings 题意:给一个字符串,问这个字符串是否能由另一个字符串重复R次得到,求R的最大值. #include <iostream> #include <stdio.h> #include <string.h> /* 题意: 给一个字符串,问这个字符串是否能由另一个…
Period Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4437    Accepted Submission(s): 2145 Problem Description For each prefix of a given string S with N characters (each character has an ASCII…
Period Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4325    Accepted Submission(s): 2087 Problem Description For each prefix of a given string S with N characters (each character has an ASCI…
Oulipo Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 49378   Accepted: 19617 Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quot…
题目传送门 /* 题意:求一个串重复出现(>1)的位置 KMP:这简直和POJ_2406没啥区别 */ /************************************************ * Author :Running_Time * Created Time :2015-8-10 9:13:24 * File Name :POJ_1961.cpp ************************************************/ #include <cstd…
POJ 2431 Expedition(探险) Time Limit: 1000MS   Memory Limit: 65536K [Description] [题目描述] A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock an…
POJ 3414 Pots(罐子) Time Limit: 1000MS    Memory Limit: 65536K Description - 题目描述 You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i)        fill the pot i (1 ≤ i ≤ 2) from the ta…