字典树
smallacmer
这个作者很懒,什么都没留下…
展开
-
http://acm.nyist.net/JudgeOnline/status.php?pid=290
动物统计加强版时间限制:3000 ms | 内存限制:150000 KB 难度:4描述 在美丽大兴安岭原始森林中存在数量繁多的物种,在勘察员带来的各种动物资料中有未统计数量的原始动物的名单。科学家想判断这片森林中哪种动物的数量最多,但是由于数据太过庞大,科学家终于忍受不了,想请聪明如你的ACMer来帮忙。输入 第一行输入动物名字的数量N(1<= N <= 4000000原创 2011-11-01 10:32:06 · 712 阅读 · 0 评论 -
http://acm.hdu.edu.cn/showproblem.php?pid=1251&&字典树
字典树水题,求公共前缀的个数。。。#include#include#include#includeusing namespace std;typedef struct Tire{ int count; struct Tire *next[26];}*Node,T;Node a;void init(){ a=(Node)malloc(sizeof(T)); for原创 2012-03-19 16:52:30 · 1169 阅读 · 0 评论 -
http://acm.hdu.edu.cn/showproblem.php?pid=1075&&字典树
这一题数据处理真坑爹。。。快耗了我一天时间。。。字典树伤不起啊。。。#include#include#include#include#include#include#includeusing namespace std;typedef struct NODE{ char *s; struct NODE *next[26]; NODE() { memset原创 2012-03-19 21:01:11 · 961 阅读 · 0 评论 -
http://acm.hdu.edu.cn/showproblem.php?pid=1247
木有输出东西,竟AC,,有木有。。#include#include#includeusing namespace std;map Q;string s[50005];int main(){ int n=0; while(cin>>s[n]) Q[s[n++]]=1; for(int i=0;i<n;++i) { int len=s[i原创 2012-03-20 09:59:51 · 496 阅读 · 0 评论