2012年8月27日
摘要: 题意就是先输入一个字典: 目标字符串-----输入字符串然后输入一个字符串,在上面的对应关系中进行查找,如果有则输出目标字符串,没有则输出eh。如果不想超时的话,明显就要套字典树了。代码贴上来,留作模板。字典树还是挺简单易懂的嘛。。。#include <iostream> #include <cstdio> #include <cstring> #include <memory.h> using namespace std; const int num_char=26; struct TrieNode { TrieNode* branch[num 阅读全文
posted @ 2012-08-27 22:26 MicZ 阅读(113) 评论(0) 推荐(0)