地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=5536 题目: Chip Factory Time Limit: 18000/9000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/O ...
分类:
其他好文 时间:
2016-10-05 21:55:46
阅读次数:
182
hdu5269 ZYB loves Xor I 异或,字典树ZYB loves Xor IAccepts: 142Submissions: 696Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Othe....
分类:
其他好文 时间:
2015-11-05 00:30:50
阅读次数:
172
分治法和字典树都可以,都是递归,但字典树耗内存 从第一bit开始,若相同则xor为0,分到同一部分,不相同则统计,且此时lowbit为这一bit,最后结果要乘以2 1 /*分治法*/ 2 #include 3 #define MOD 998244353 4 5 using namespac...
分类:
其他好文 时间:
2015-10-13 20:58:53
阅读次数:
167
题目链接: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
题意:给一个序列[a, a + n),求Σlowbit(ai, aj),i,j∈[0,n)。思路:lowbit与位有关,于是按位统计即可,如果lowbit=2^k,则前k位相同,前缀相同,于是想到用字典树来统计。12345678910111213141516171819202122232425262...
分类:
其他好文 时间:
2015-06-15 06:51:05
阅读次数:
110
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
Problem DescriptionMemphis 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,...
分类:
编程语言 时间:
2015-06-13 22:53:56
阅读次数:
226