hdu 4825 Xor Sum(trie+贪心) 刚刚补了前天的CF的D题再做这题感觉轻松了许多。简直一个模子啊。。。跑树上异或x最大值。贪心地让某位的值与x对应位的值不同即可。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstri ...
分类:
其他好文 时间:
2017-08-31 23:13:05
阅读次数:
289
题意:给出一个数列,q个询问,每个询问给出个下标,问除了该下标的数字,其他数字的and,or,xor是多少 思路:求个前缀,后缀即可 ...
分类:
其他好文 时间:
2017-08-31 19:09:26
阅读次数:
111
先上模板 接下来是例题 NBUT 1597 Find MaxXorSum 题意: 给你n个数 让你找两个数使异或值最大 思路: 构造一棵字典树 用字典树求异或值 hdu 4825 Xor Sum 中文题意不解释 ...
分类:
其他好文 时间:
2017-08-31 14:38:39
阅读次数:
161
Query on A Tree 题目描述 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 kee ...
分类:
其他好文 时间:
2017-08-31 12:41:22
阅读次数:
252
题目描述 输入 第一行一个正整数,表示数据组数据 ,接下来T行每行一个正整数N 输出 2*T行第2*i-1行表示第i个数据中问题一的解, 第2*i行表示第i个数据中问题二的解, 样例输入 1 1 样例输出 1 2 题解 数位dp+矩阵乘法 $x\ xor\ 3x=2x$即$x\ xor\ 2x=3x ...
分类:
其他好文 时间:
2017-08-29 21:37:58
阅读次数:
134
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2115 解法: 膜:http://www.cnblogs.com/ljh2000-jump/p/5869925.html 这道题要求从1到n的最大xor和路径,存在重边,允许经过重复点、重复边 ...
分类:
其他好文 时间:
2017-08-29 20:41:26
阅读次数:
193
题解: 首先用二进制表示每个音阶是否使用,那么共有$2^{n}-1$(空集不可行)种片段,用$a_{i}$来表示每个片段,问题就是求满足$a_{1}\left (xor\right)a_{2}\left (xor\right)......\left (xor\right)a_{m}==0\&\&a_ ...
分类:
其他好文 时间:
2017-08-26 10:16:17
阅读次数:
101
转http://blog.sina.com.cn/s/blog_8b79cd290102w7k9.html http://www.cnblogs.com/IPYQ/p/6791256.html 问题原因 数字校园应用的REDIS缓存系统存在BUG,致使服务器被注入了入侵者自己生成的公匙,并上传到了R ...
分类:
其他好文 时间:
2017-08-25 16:58:07
阅读次数:
361
Xor HYSBZ - 2115 题意:给一个树,求1到n的最长路径。这里的路径定义为异或和。 线性基~~ 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define ll long long 4 struct LiBase{ 5 ll a ...
分类:
其他好文 时间:
2017-08-24 23:53:38
阅读次数:
230
724G - Xor-matic Number of the Graph 题意: 待补~~ 参考http://www.cnblogs.com/ljh2000-jump/p/6443189.html ...
分类:
其他好文 时间:
2017-08-24 23:52:42
阅读次数:
234