codevs 4189 trie树(字典树入门)

题目:http://codevs.cn/problem/4189/

这篇博客讲的超级好:https://www.cnblogs.com/TheRoadToTheGold/p/6290732.html

#include<bits/stdc++.h>
using namespace std;
const int maxx=2000010;
char s[100];
int trie[maxx][26];//trie[rt][x]=tot:rt是上个节点编号,x是字母,tot是下个节点编号
int tot=1;
void insert(char *s)
{
    int rt=1;
    for(int i=0;s[i]!='