![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字典树
laserss
laserss@qq.com
展开
-
hdu1251 统计难题 字典树
hdu 1251 统计难题 字典树的解释及模板 背下来.. #include using namespace std; struct trie { int num; bool isword; trie *child[26]; trie() { for(int i=0;i<26;i++) child[i]=0; num=0;isword=0; } }原创 2012-07-26 15:02:02 · 849 阅读 · 0 评论 -
hdu1075 What Are You Talking About-字典树
hdu1075 What Are You Talking About 模板是对了,但是题目的格式没弄清楚,然后换了一个主函数ac了。。。。 #include using namespace std; struct trie { bool isword; char word[11]; trie *child[26]; trie() { for(int i=0;i原创 2012-07-26 19:26:47 · 718 阅读 · 0 评论 -
hdu1671Phone List - 字典树
hdu1671Phone List 简单的字典树 空间换时间,花销超大,,,如果有多组数据的话 呃 那用完就释放吧 , 恩 。 #include using namespace std; struct trie { bool exist; int num; trie *next[10]; trie() { exist=0; num=0; for(int i=0;原创 2012-07-27 16:12:50 · 789 阅读 · 0 评论 -
hdu1305字典树
hdu1305 #include using namespace std; struct trie { int num; trie *child[2]; trie() { for(int i=0;i<2;i++) child[i]=0; num=0; } } *root; int flag; void Insert(char *x) { int k=0;trie原创 2012-11-10 19:43:29 · 853 阅读 · 0 评论