摘要: 题目link:http://acm.hdu.edu.cn/showproblem.php?pid=1857先简述一下题目:有一个RXC的字母矩形,R,C在500内,要匹配m个单词,m在100000内,每个单词长度不超过20,匹配方法为向右或者向下,或者右下,即三个方向,0度,90度,45度。现在要输... 阅读全文
posted @ 2014-04-22 10:26 dengyaolong 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 附上代码#include#include#include#include#include#includeusing namespace std;templatestruct trie_node{ bool terminable; //表示节点为字符串的结尾 int node; //子节点的个数 int id; trie_node *child[Size]; //儿子节点 trie_node():terminable(false), node(0){ memset(child,0,sizeof(child)); //初始化节点 } };int RR[10200],CC[10200];temp.. 阅读全文
posted @ 2014-04-22 10:08 dengyaolong 阅读(154) 评论(0) 推荐(0) 编辑