![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
文章平均质量分 84
bool_isprime
这个作者很懒,什么都没留下…
展开
-
hdu1711 Number Sequence
今天学了下KMP算法,差不多理解咯,这题只要套一下模板就可以ko。昨天看了下最小表示法算法。看到中间头晕咯。相当无语,到现在还没懂。includeusing namespace std;const int maxn=1000005;const int maxm=10005;int a[maxn],b[maxm],next[maxm];int n,m;void getNext(int *p, int m, int *next) { int i = 0, j = next[0] = -1; whi原创 2010-08-18 23:31:00 · 395 阅读 · 0 评论 -
hdu1251
题意:统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).字典树 今天晚上刚学的。。算法无涯啊。好多东西都不知道。/*Sample Inputbanana band bee absolute acm ba b band abc Sample Output2 3 1 0 */#include#include#includestruct dirtree{ struct dirtree *child[26]; int n;};struct dirtree *ro原创 2010-08-18 23:39:00 · 461 阅读 · 0 评论 -
hdu1247Hat’s Words
<br />字典树,感觉有点暴力。<br />Hat’s Words Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 4 Accepted Submission(s) : 4Font: Times New Roman | Verdana | GeorgiaFont Size: ←→Problem DescriptionA hat’s word is原创 2010-08-26 14:52:00 · 454 阅读 · 0 评论 -
hdu1325Is It A Tree?
<br />题意:能否构成一棵树。。怎么感觉像图论的知识,放在字符串专题里。<br /><code><br />#include<stdio.h><br />#include<iostream><br />#include<string.h><br />#define pr printf<br />using namespace std;<br />int main()<br />{<br /> <br /> int i,j,k,m,n,T,ca,E,V,indeg,zero,root;<br原创 2010-08-26 19:06:00 · 469 阅读 · 0 评论