![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
01字典树
mmk27
这个作者很懒,什么都没留下…
展开
-
HDU - 6191 Query on A Tree 01字典树 + 可持久化
Monkey A lives on a tree, he always plays on this tree. One day, monkey A learned about one of the bit-operations, xor. He was keen of this interesting operation and wanted to practise it at once. Mon...原创 2018-12-06 13:35:43 · 308 阅读 · 0 评论 -
HDU - 5536 Chip Factory 01字典树
题目链接:https://vjudge.net/problem/HDU-5536#author=SCU2018 题意:求max( (a[i] + a[j]) xor a[k] ) (i, j, k互不相同) 题解:因为n只有1000,所以可以枚举 i j,然后其他数建字典树,对应直接查询即可 #include <bits/stdc++.h> using namespace st...原创 2019-08-16 15:26:16 · 125 阅读 · 0 评论 -
HDU - 4825 Xor Sum 01字典树
题目链接:https://vjudge.net/problem/HDU-4825 题解:字典树保存下来,从高位到低位处理 #include <bits/stdc++.h> using namespace std; const int N = 100010; struct node { int nex[2]; int sum; }tree[N * 35]; int n, m, ...原创 2019-08-16 15:38:39 · 135 阅读 · 0 评论 -
HYSBZ - 3261 最大异或和 可持久化字典树
题目链接:https://vjudge.net/problem/HYSBZ-3261#author=upc_201713 有M个操作,有以下两种操作类型: 1、A x:添加操作,表示在序列末尾添加一个数x,序列的长度N+1。 2、Q l r x:询问操作,你需要找到一个位置p,满足l<=p<=r,使得: a[p] xor a[p+1] xor ... xor a[N] xor ...原创 2019-08-16 17:08:38 · 114 阅读 · 0 评论