Qiuqiqiu  
不管道路多么崎岖坎坷,我永远不停下追逐梦想的脚步!

2012年4月28日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1247字典树读入的时候必须用scanf,用gets就错View Code 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 const int N=50010; 6 const int SZ=100000,CH=26; 7 int chd[SZ][CH],key[SZ]; 8 int sz=0; 9 char w[N][50];10 int n=0;11 void insert(char *str)1 阅读全文
posted @ 2012-04-28 20:01 Qiuqiqiu 阅读(157) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1880最初的想法直接快排+二分查找为了练习hash就用hash做了View Code 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 const int N=100010,MAXH=100003; 6 char w0[N][25],w1[N][85]; 7 int head[2][MAXH],next[2][N]; 8 int n; 9 int hash(char *key)10 {11 unsig 阅读全文
posted @ 2012-04-28 19:02 Qiuqiqiu 阅读(274) 评论(0) 推荐(0) 编辑