码迷,mamicode.com
首页 >  
搜索关键字:字典树    ( 1305个结果
hdu 4825 xor sum(字典树+位运算)
Xor Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 4144 Accepted Submission(s): 1810 Probl ...
分类:其他好文   时间:2018-05-27 19:44:08    阅读次数:162
字典树(指针 找单词)
struct node { node *next[28]; bool is; node() { is=false; memset(next,0,sizeof(next)); } }; void insert(node *root,char s[]) { int i=0; node *p=root; ... ...
分类:其他好文   时间:2018-05-27 12:12:32    阅读次数:157
字典树(数组 查找前缀)
int trie[400001][26],len,root,tot,sum[400001]; bool p; int n,m; char s[11]; void insert() { len=strlen(s); root=0; for(int i=0;i<len;i++) { int id=s[i... ...
分类:编程语言   时间:2018-05-27 10:47:47    阅读次数:164
字典树 (指针)
char s[11]; int n,m; bool p; struct node { int count; node * next[26]; }*root; node * build() { node * k=new(node); k->count=0; memset(k->next,0,sizeo... ...
分类:其他好文   时间:2018-05-27 10:45:11    阅读次数:178
学后整理
数据结构 树状数组 线段树 主席树 字符串 字符串hash AC自动机 字典树 杂 数论 逆元 思维 贪心 博弈 二分 && 三分 双指针 图 ...
分类:其他好文   时间:2018-05-27 00:24:08    阅读次数:172
Codeforces 979 D. Kuro and GCD and XOR and SUM(异或和,01字典树)
"Codeforces 979 D. Kuro and GCD and XOR and SUM" 题目大意:有两种操作:①给一个数v,加入数组a中②给出三个数x,k,s;从当前数组a中找出一个数u满足 u与x的gcd可以被k整除,u不大于s x,且与x的异或和最大。 思路:之前没有碰到过异或和最值的 ...
分类:其他好文   时间:2018-05-25 21:13:33    阅读次数:151
字典树与01字典树
之前在做一道关于字符串匹配的题时,用到了 "字典树" ,但那时是用指针实现的,这次又遇到需要使用字典树这一结构的题,向学姐要了她的板子,学习了用数组实现的方法,对于解题而言,更为简短快速。 因为题目要求最大异或和,因此用的是01字典树,在字典树的基础上稍作修改。 以下为字典树和01字典树的普遍实现: ...
分类:其他好文   时间:2018-05-25 21:08:27    阅读次数:101
Codeforces Round #482 (Div. 2)D. Kuro and GCD and XOR and SUM+字典树
题目链接:D. Kuro and GCD and XOR and SUM 题意:两种操作:第一种给数组添加一个数,第二种输入x,k,s,要求从数组中找到一个数v,要求k能整除gcd(k,v);并且v<=s-x,然后异或v与k的异或值最大。 题解:对与k大于1的情况我们暴力枚举过去,k为1的特殊处理建 ...
分类:其他好文   时间:2018-05-22 23:58:35    阅读次数:328
codeforces 979D - Kuro and GCD and XOR and SUM
标签(空格分隔): Trie树 题目链接 http://codeforces.com/problemset/problem/979/D 题意 给定一个空集合,有两种操作: 一种是往集合中插入一个元素,一种是给三个数$x,k,s$,问集合中是否存在$v$,使得$x\ mod\ k==0$且$v\ mo ...
分类:其他好文   时间:2018-05-21 21:15:51    阅读次数:164
字典树模板
求最大异或 ...
分类:其他好文   时间:2018-05-20 14:23:52    阅读次数:155
1305条   上一页 1 ... 31 32 33 34 35 ... 131 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!