题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1251
题意: 中文题诶~
思路: 字典树模板
代码1: 动态内存, 比较好理解一点, 不过速度略慢, 代码略长
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include <iostream> 2 #include <stdio.h> 3 #include <string.h> 4 using namespace std; 5 6 const int MAXN = 26; 7 const int MAX = 11; 8 char str[MAX]; 9 10 struct node{ 11 int count; 12 node *next[MAXN]; 13 node(){ 14 count = 0; 15 for(int i = 0; i < MAXN; i++){ 16 next[i] = NULL; 17 } 18 } 19 }; 20 21 void insert(node *p, char *str){ 22 for(int i = 0; str[i] != '