摘要:
1 /* 2 * 并查集+字典树 3 */ 4 5 #include <cstdio> 6 #include <cstdlib> 7 #include <cstring> 8 #include <iostream> 9 10 using namespace std;11 12 const int N = 21;13 const int M = 200005;14 15 int cs;16 int parent[M];17 char strA[N], strB[N];18 struct node {19 int c;20 node *child[5 阅读全文
posted @ 2012-05-08 18:27
Try86
阅读(376)
评论(0)
推荐(0)
摘要:
1 /* 2 * 字典树 3 */ 4 #include <cstdio> 5 #include <cstring> 6 #include <cstdlib> 7 #include <iostream> 8 9 using namespace std;10 11 const int N = 11;12 13 bool yes;14 char str[N];15 struct node {16 bool flag;17 node *child[10];18 node() {19 flag = false;20 for (int i=... 阅读全文
posted @ 2012-05-08 07:11
Try86
阅读(141)
评论(0)
推荐(0)
摘要:
1 /* 2 * 字典树 3 * 思路:把所有单词建成一棵字典树,然后把每个分成两部分,判断这两部分是否在树中 4 * 是,就符合条件。 5 */ 6 7 #include <cstdio> 8 #include <cstdlib> 9 #include <cstring>10 #include <iostream>11 12 using namespace std;13 14 const int N = 16;15 const int M = 50005;16 17 char strL[N], strR[N], dic[M][N]; 18 st 阅读全文
posted @ 2012-05-08 07:03
Try86
阅读(739)
评论(0)
推荐(0)
浙公网安备 33010602011771号