随笔分类 -  数据结构 —— 字典树

51Nod XOR key —— 区间最大异或值 可持久化字典树
摘要:题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1295 1295 XOR key 题目来源: HackerRank 基准时间限制:1.5 秒 空间限制:262144 KB 分值: 160 难度:6级算法题 收藏 阅读全文

posted @ 2018-04-06 16:29 h_z_cong 阅读(606) 评论(0) 推荐(0)

HDU4825 Xor Sum —— Trie树
摘要:题目链接:https://vjudge.net/problem/HDU-4825 Xor Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)Total Submission(s) 阅读全文

posted @ 2018-04-06 15:29 h_z_cong 阅读(244) 评论(0) 推荐(0)

POJ3376 Finding Palindromes —— 扩展KMP + Trie树
摘要:题目链接:https://vjudge.net/problem/POJ-3376 Finding Palindromes Time Limit: 10000MS Memory Limit: 262144K Total Submissions: 4244 Accepted: 796 Case Time 阅读全文

posted @ 2017-11-26 13:07 h_z_cong 阅读(535) 评论(0) 推荐(1)

Codeforces Round #173 (Div. 2) E. Sausage Maximization —— 字典树 + 前缀和
摘要:题目链接:http://codeforces.com/problemset/problem/282/E E. Sausage Maximization time limit per test 2 seconds memory limit per test 256 megabytes input st 阅读全文

posted @ 2017-06-29 10:17 h_z_cong 阅读(240) 评论(0) 推荐(0)

BestCoder Round #92 1001 Skip the Class —— 字典树 or map容器
摘要:题目链接:http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=748&pid=1001 题解: 1.trie树 关键是如何将科目与分数进行对应,即如果将字符串与数字对应。由于之前解除了字典树,所以就想到用字典树存储单词,并 阅读全文

posted @ 2017-03-17 14:42 h_z_cong 阅读(260) 评论(0) 推荐(0)

poj2513 Colored Sticks —— 字典树 + 并查集 + 欧拉回路
摘要:题目链接:http://poj.org/problem?id=2513 题解:通过这题了解了字典树。用字典树存储颜色,并给颜色编上序号。这题为典型的欧拉回路问题:将每种颜色当成一个点。首先通过并查集判断是否为连通图,再检验是否符合欧拉回路的特点。不过题目有一点很奇怪,在并查集中,若图为连通,不是有且 阅读全文

posted @ 2017-02-23 21:25 h_z_cong 阅读(247) 评论(0) 推荐(0)

导航