随笔分类 -  字符串:Trie树

【HDU1075】What Are You Talking About
摘要:火星文Trie插入 对应英文存到数组查询 对于每一个火星文句子,拆成若干单词分别在Trie树中查询 PS:开数组的话要开大,大概100W左右,不然会一直RE…… 1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 #defi 阅读全文
posted @ 2016-10-08 21:50 Absolutezero 阅读(206) 评论(0) 推荐(0)
【POJ2001】Shortest Prefixes
摘要:Trie树 1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 int trie[300010][30],sum[300010],cnt,n; 5 char s[1010][25]; 6 void insert(int le 阅读全文
posted @ 2016-10-05 17:06 Absolutezero 阅读(110) 评论(0) 推荐(0)