poj 3630 Phone List Trie树
摘要:
题意:给一组互不相同的序列,问其中是否有字符串是另一字符串的前缀思路:Trie树水题 1 #include<iostream> 2 using namespace std; 3 #define MAXN 100010 4 struct node 5 { 6 bool end; 7 node *next[10]; 8 }; 9 node *root;10 int top=0;11 bool is_new,ans;12 node memo[MAXN];13 void insert(node *t,char c[],int i)14 {15 if(t->end)16 ... 阅读全文
posted @ 2012-02-10 17:06 myoi 阅读(188) 评论(0) 推荐(0) 编辑