题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5269 ,BestCoder Round #44的B题,关于字典树的应用。 比赛的时候没想出做法,现在补上。题解: 我们考虑,当lowbit(A xor B) = 2p时,A和B表示的二进制数的后...
分类:
其他好文 时间:
2015-06-19 20:14:59
阅读次数:
112
题目2 : 计数
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
描述
Rowdark是一个邪恶的魔法师。在他阅读大巫术师Lich的传记时,他发现一类黑魔法来召唤远古生物,鱼丸。
魔法n能召唤类型i鱼丸当且仅当i能够被表示为x
xor n*x对于某个正整数x和固定的n。
Rowdark想知道类型为[L,R]之间的鱼丸...
分类:
其他好文 时间:
2015-06-19 16:50:46
阅读次数:
113
一、运算符:1、算数运算符:+、-、*、/、%、++、--2、字符串运算符:3、赋值运算符:①=、②+=、③-=、④*=、⑤/=、⑥%=、⑦.=4、位运算符:&、|、~、^、>5、比较运算符:>、=、、===、!==6、逻辑运算符:AND、OR、XOR、&&、||、!二、流程控制:1、if(){}、...
分类:
Web程序 时间:
2015-06-19 10:12:36
阅读次数:
129
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5269思路分析:当lowbit(AxorB)=2p 时,表示A与B的二进制表示的0-p-1位相等,第p位不同;考虑维护一棵字母树,将所有数字转换为二进制形式并且从第0位开始插入树中,并在每个节点中记录通过...
分类:
其他好文 时间:
2015-06-16 07:59:37
阅读次数:
106
时间限制:10000ms单点时限:1000ms内存限制:256MB描述Rowdark是一个邪恶的魔法师。在他阅读大巫术师Lich的传记时,他发现一类黑魔法来召唤远古生物,鱼丸。魔法n能召唤类型i鱼丸当且仅当i能够被表示为x xor n*x对于某个正整数x和固定的n。Rowdark想知道类型为[L,R...
分类:
其他好文 时间:
2015-06-15 00:04:33
阅读次数:
127
HDU 5269 ZYB loves Xor I( 01 Trie 树)...
分类:
其他好文 时间:
2015-06-14 11:02:19
阅读次数:
410
题目链接:hdu 5269ZYB loves Xor ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 184Accepted Submission...
分类:
其他好文 时间:
2015-06-14 10:56:11
阅读次数:
125
Memphis loves xor very musch.Now he gets an array A.The length of A is n.Now he wants to know the sum of all (lowbit(Ai xor Aj)) (i,j∈[1,n])
We define that lowbit(x)=2k,k
is the smallest integer sa...
分类:
其他好文 时间:
2015-06-14 09:34:19
阅读次数:
150
今晚best code第二题
好好学了下字典树,确实自己会的东西实在太少了
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define inf 1<<30
#define Inf -1<<30
#define maxn 50000+5
#de...
分类:
其他好文 时间:
2015-06-14 09:31:51
阅读次数:
152