the little red hencat of j...

帮做下,9.i'm going out of __ this afternoon on holiday.A.town B.the town c.a town10.the little cat is sitting __ the foot of the stairs while her mother is sitting at the top.A.on B.by c.at23.please let me know if you have any __ qusetions.A.futher B.farther c.father25.i forgot __ you that you have an appointment this afternoon.A.tell B.telling c.to tell26.you should __ an appointment once you have __ it.A.make...kept B.keep...made c.make...had
1.A ( 固定搭配,如:Many people go out of town for a long holiday weekend)10 C (固定,如; unit building located at the foot of the Lyon Street stairs )23.B ( far 的比较级是:further,farther)25 C ( forget to do sth.忘记做某事)26 B ( keep an appointment遵守承诺,make an appointment 约定)
为您推荐:
其他类似问题
B,town是可数名词,需要冠词修饰,整句话表特指,故选BA,at the top\bottom,on the footB, far的比较级只有further和farther两种形式,整句话的意思是“如果你有更深入的问题,请告诉我。”这里考察单词拼写。C,forget doing表示自己做过但是忘记自己做了 ,forget to do表示忘记将来要做的事,整句意思是“...
acacb我是美国人,我就会这样回答……good luck~
9 a10 a23 b25 c26 b
不懂的就别胡说了吧
扫描下载二维码posts - 390,&
comments - 44,&
trackbacks - 0
Seek the Name, Seek the Fame
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 8261
Accepted: 3883
Description
The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek the fame. In order to escape from such boring job, the innovative little cat works out an easy but fantastic algorithm: Step1. Connect the father's name and the mother's name, to a new string S. Step2. Find a proper prefix-suffix string of S (which is not only the prefix, but also the suffix of S). Example: Father='ala', Mother='la', we have S = 'ala'+'la' = 'alala'. Potential prefix-suffix strings of S are {'a', 'ala', 'alala'}. Given the string S, could you help the little cat to write a program to calculate the length of possible prefix-suffix strings of S? (He might thank you by giving your baby a name:)
The input contains a number of test cases. Each test case occupies a single line that contains the string S described above. Restrictions: Only lowercase letters may appear in the input. 1 &= Length of S &= 400000.
For each test case, output a single line with integer numbers in increasing order, denoting the possible length of the new baby's name.
Sample Input
ababcababababcabab
Sample Output
大致题意:& & 给出一个字符串str,求出str中存在多少子串,使得这些子串既是str的前缀,又是str的后缀。从小到大依次输出这些子串的长度。
大致思路:& &&如左图,假设黑色线来代表字符串str,其长度是len,红色线的长度代表next[len],根据next数组定义易得前缀的next[len]长度的子串和后缀next[len]长度的子串完全相同(也就是两条线所对应的位置)。我们再求出next[len]位置处的next值,也就是图中蓝线对应的长度。同样可以得到两个蓝线对应的子串肯定完全相同,又由于第二段蓝线属于左侧红线的后缀,所以又能得到它肯定也是整个字符串的后缀。
& & 所以对于这道题,求出len处的next值,并递归的向下求出所有的next值,得到的就是答案。
1 #include&stdio.h&
2 #include&string.h&
4 int next[400005];
5 char s[400005];
6 int sum[400000];
8 void get_next(int len)
next[0]=-1;
while(i&len)
if(j==-1||s[i]==s[j])
next[i]=j;
j=next[j];
27 int main()
int len,i,k;
while(scanf("%s",s)!=EOF)
len=strlen(s);
get_next(len);
for(i=i!=0;)
sum[k++]=next[i];
i=next[i];
for(i=k-2;i&=0;--i)
printf("%d ",sum[i]);
printf("%d\n",len);
阅读(...) 评论()114网址导航

我要回帖

更多关于 the little red hen 的文章

 

随机推荐