上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 57 下一页

2014年7月2日

【ZOJ】3430 Detect the Virus

摘要: 动态建树MLE。模仿别人的代码模板各种原因wa后,终于AC。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 515*70 8 #define NXTN... 阅读全文

posted @ 2014-07-02 20:40 Bombe 阅读(256) 评论(0) 推荐(0) 编辑

2014年6月30日

【HDOJ】2896 病毒侵袭

摘要: AC自动机模板题。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <queue> 5 using namespace std; 6 7 #define TRIEN 128 8 #define MAX 阅读全文

posted @ 2014-06-30 00:27 Bombe 阅读(284) 评论(0) 推荐(0) 编辑

2014年6月29日

【HDOJ】2222 Keywords Search

摘要: AC自动机基础题。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cstdlib> 5 #include <queue> 6 using namespace std; 7 8 #define MA 阅读全文

posted @ 2014-06-29 12:46 Bombe 阅读(199) 评论(0) 推荐(0) 编辑

【POJ】3283 Card Hands

摘要: 字典树。 阅读全文

posted @ 2014-06-29 00:24 Bombe 阅读(167) 评论(0) 推荐(0) 编辑

2014年6月28日

【POJ】2513 Colored Sticks

摘要: 字典树+并查集。 1 #include 2 #include 3 #include 4 5 #define MAXN 500005 6 #define MAXL 11 7 #define TRIEN 26 8 9 typedef struct Trie { 10 ... 阅读全文

posted @ 2014-06-28 22:21 Bombe 阅读(148) 评论(0) 推荐(0) 编辑

【POJ】1204 Word Puzzles

摘要: 这道题目各种wa。首先是错了一个坐标,居然没测出来。然后是剪枝错误。搜索pen时就返回,可能还存在串pen*。 1 #include 2 #include 3 #include 4 5 #define MAXN 1005 6 7 typedef struct Trie { 8 in... 阅读全文

posted @ 2014-06-28 17:19 Bombe 阅读(179) 评论(0) 推荐(0) 编辑

【POJ】1816 Wild Words

摘要: DFS+字典树。题目数据很BT。注意控制DFS深度小于等于len。当'\0'时,还需判断末尾*。另外,当遇到*时,注意讨论情况。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 usin... 阅读全文

posted @ 2014-06-28 12:47 Bombe 阅读(185) 评论(0) 推荐(0) 编辑

【HDOJ】1247 Hat’s Words

摘要: 字典树。 1 #include 2 #include 3 #include 4 5 #define MAXN 50005 6 #define MAXL 25 7 8 typedef struct Trie { 9 bool f;10 Trie *next[26];11 ... 阅读全文

posted @ 2014-06-28 10:56 Bombe 阅读(119) 评论(0) 推荐(0) 编辑

2014年6月27日

【HDOJ】2609 How many

摘要: 循环同构的最小表示法。 1 #include <cstdio> 2 #include <cstring> 3 4 #define MAXN 10005 5 #define MAXL 105 6 7 char map[MAXN][MAXL]; 8 char buf[MAXL]; 9 10 int Mi 阅读全文

posted @ 2014-06-27 22:15 Bombe 阅读(164) 评论(0) 推荐(0) 编辑

【POJ】1035 Spell checker

摘要: 字典树。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 typedef struct Trie { 10 int in;... 阅读全文

posted @ 2014-06-27 17:18 Bombe 阅读(201) 评论(0) 推荐(0) 编辑

上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 57 下一页

导航