题目的意思是一个字符串有某个长度为k的字符串通过不断重复形成的,而k被称为该字符串的周期.而我们所要做的是找出该字符串的最小周期. input The first line is an integer T,That means there are have T test cases; the following T lines are T strings; output Each line is an answer,and there a blank line between two answe…
#include <stdio.h>#include <string.h> int main(){    int T, k, len;    char str[81], *p, *q, *end;    scanf("%d", &T);    while (T--)    {        scanf("%s", str);        len = strlen(str);        end = str+len;        …
如果一个字符串可以被某个长度为k的字符串重复多次得到,则称这个字符串的周期为k.例如,字符串"abcabcabcabc"以3为周期(当然,他也以6.12等等为周期).  现在请你编写一个程序,求出任一长度不超过80的字符串的最小周期. Input 输入首先是一个整数n,代表有n组数据. 每组数据占一行,是一个长度不超过80的字符串. 两组相邻的输入之间有一个空行. Output 每组数据在一行内输出一个整数k,代表该字符串的最小周期. 两组相邻的输出之间应当有一个空行. Sample…
一:这种结论,个人觉得仍然存疑 http://www.cnblogs.com/wangshuai901/archive/2012/05/06/2485657.html 1.null    null 关键字是表示不引用任何对象的空引用的文字值.null 是引用类型变量的默认值.那么也只有引用型的变量可以为NULL,如果 int i=null,的话,是不可以的,因为Int是值类型的. 2.,""和String.Empty    这两个都是表示空字符串.只不过""理论上重…
考试排名 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 11620    Accepted Submission(s): 4117 Problem Description C++编程考试使用的实时提交系统,具有即时获得成绩排名的特点.它的功能是怎么实现的呢? 我们做好了题目的解答,提交之后,要么“AC”,要么错误,不管怎样错法,总是给…
Period Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2258    Accepted Submission(s): 1117 Problem Description For each prefix of a given string S with N characters (each character has an ASCII…
Period Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 16776   Accepted: 8077 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…
Period Time Limit: 3000MSMemory Limit: 30000K Total Submissions: 12089Accepted: 5656 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 prefi…
[LA3026]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 each i (2 ≤ i ≤ N) we want to know the l…
Period Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2120    Accepted Submission(s): 1039 Problem Description For each prefix of a given string S with N characters (each character has an ASCI…