CF1493E Enormous XOR】的更多相关文章

题目传送门. 题意简述:给出长度为 \(n\) 的二进制数 \(l,r\),求 \(\max_{l\leq x\leq y\leq r}\oplus_{i=x}^yi\). 非常搞笑的题目,感觉难度远远没有 CF 上的 *2600. 首先,如果 \(l,r\) 的最高位不同,那么答案显然为 \(2^n-1\).当 \(x=2^{n-1}-1,y=2^{n-1}\) 时可以取到. 如果 \(l,r\) 的最高位相同,那么我们肯定是选奇数个数,即 \(y\equiv x\pmod 2\).如果选偶数…
本博客将会收录一些贪心/构造的我认为较有价值的题目,这样可以有效的避免日后碰到 P7115 或者 P7915 这样的题就束手无策进而垫底的情况/dk 某些题目虽然跟贪心关系不大,但是在 CF 上有个 greedy 的 tag,这种题目大概率也会被我收录进来(比方说这篇博客里大概率会收录不少 DP 题,因为 CF 上不少 DP 题都莫名其妙地打上了一个 greedy 的 tag 1. CF1592F1 Alice and Recoloring 1 首先很明显我们不会选择翻转包含 \((1,m),(…
Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum result of ai XOR aj, where 0 ≤ i, j < n. Could you do this in O(n) runtime? Example: Input: [3, 10, 5, 25, 2, 8] Output: 28 Explanation: The maximum resul…
题目链接 XOR 游戏 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 256    Accepted Submission(s): 86 Problem Description众所周知,度度熊喜欢XOR运算[(XOR百科)](http://baike.baidu.com/view/674171.htm). 今天,它发明了一种XOR新游戏…
Description Input 第一行包含两个整数N和 M, 表示该无向图中点的数目与边的数目. 接下来M 行描述 M 条边,每行三个整数Si,Ti ,Di,表示 Si 与Ti之间存在 一条权值为 Di的无向边. 图中可能有重边或自环. Output 仅包含一个整数,表示最大的XOR和(十进制结果),注意输出后加换行回车. 这道题好像是很久以前学线性基的时候留下的--现在来填个坑-- 首先,由于异或有一个很好的性质,就是两个相同的数异或起来等于零.所以,一条边重复走两遍不会对答案产生贡献.这…
前段时间的一次样本,需要给出专杀,应急中遇到的是linux中比较常见的两个家族gates和xor. 首先是xor的专杀脚本,xor样本查杀的时候需要注意的是样本的主进程和子进程相互保护(详见之前的xor ddos分析http://www.cnblogs.com/goabout2/p/4888651.html),想要杀掉的话,需要先通过kill –stop挂起主进程,再删除其他的文件,但是由于xor的进程名是随机值,同时主机上还有有gates木马(gates最显著的特征就是会替换系统文件ps,ls…
XOR and Favorite Number time limit per test: 4 seconds memory limit per test: 256 megabytes input: standard input output: standard output Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pa…
#include <cstdio> #include <cstring> ; ; int cnt,Ans,b,x,n; inline int Max(int x,int y) {return x>y?x:y;} ];}Tree[Maxn*Len]; void Insert(int x) { ; bool k; ;i--) { k=x&(<<i); ) Tree[Now].next[k]=++cnt; Now=Tree[Now].next[k]; } } i…
http://acm.hdu.edu.cn/showproblem.php?pid=5661 Claris and XOR Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 146    Accepted Submission(s): 51 Problem Description Claris loves bitwise operatio…
异或链表(Xor Linked List)也是一种链式存储结构,它可以降低空间复杂度达到和双向链表一样目的,任何一个节点可以方便的访问它的前驱节点和后继结点.可以参阅wiki 普通的双向链表 class Node { public: int data; Node *prev; Node *next; }; class BiLinkedList { public: Node *head; Node *tail; }; 普通双向链表的一个节点表示如下: 完整的普通双向链表如下所示:   对于异或链表…