uva 11732 (trie树)
摘要:
题意:求N个字符串两两比较,共比较了多少次?#include#include#includeusing namespace std;typedef long long LL;const int maxnode = 4000 * 1000 + 10;// 字母表为全体小写字母的Triestruct Trie{ int head[maxnode]; // head[i]为第i个结点的左儿子编号 int next[maxnode]; // next[i]为第i个结点的右兄弟编号 char ch[maxnode]; // ch[i]为第i个结点上的字符 int tot[max... 阅读全文
posted @ 2014-03-26 17:56 雄.. 阅读(186) 评论(0) 推荐(0)
浙公网安备 33010602011771号