字典树
sunyutian1998
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
T9 HDU - 1298
http://acm.hdu.edu.cn/showproblem.php?pid=1298建两棵字典树 一棵用小写字母建 用来维护所有包括当前前缀的字符串的出现概率之和 另一棵用数字建看当前数字前缀下根据第一棵字典树应该用哪个字母前缀表示#include <bits/stdc++.h>using namespace std;struct node{ node...原创 2018-07-24 19:27:05 · 265 阅读 · 0 评论 -
What Are You Talking About HDU - 1075
http://acm.hdu.edu.cn/showproblem.php?pid=1075用map也可以做的SB题 数据读入真的有毒 还不给数据范围将地球文先存到二维字符数组 用火星文建树 将火星文对应的地球文的指针赋给树上对应的节点#include <cstdio>#include <cstring>#include <algorithm>...原创 2018-07-24 15:41:26 · 283 阅读 · 0 评论 -
again and again QDU - 65
https://qduoj.com/problem/65提前把所有字符串按字典序排序 然后插入字符串时比较一下 维护以当前节点结尾字符串的所有后缀中的最短的那个字符串#include <bits/stdc++.h>using namespace std;#define N 0x3f3f3f3fstruct node1{ char ch[30];};st...原创 2018-07-24 13:00:34 · 322 阅读 · 0 评论 -
统计难题 HDU - 1251 + Phone List HDU - 1671
点击打开链接两道字典树模板 没啥说的 借鉴博客点击打开链接1251可能是哪里有bug hdu上用G++提交就会MLE 只能过C++ 待解。。但用同样方法写1671就没问题 难道是数据水 hdu1251#include <cstdio>#include <cstring>#include <algorithm>using names...原创 2017-11-05 00:13:38 · 251 阅读 · 0 评论 -
Spy Syndrome 2 CodeForces - 633C
http://codeforces.com/problemset/problem/633/C这里DFS的作用和for循环一样 复杂度有点迷。。感觉是因为这里用了字典树来剪枝 匹配的要求比较严格 当前位置找不到就必须返回#include <bits/stdc++.h>using namespace std;struct node{ node *next[26...原创 2018-09-11 10:54:15 · 213 阅读 · 0 评论
分享