
哈希
木木木木子子子
这个作者很懒,什么都没留下…
展开
-
hdu 3833 YY's new problem hash
Problem DescriptionGiven a permutation P of 1 to N (表明出现的数字从1到N,只是顺序打乱), YY wants to know whether there exists such three elements P[i1], P[i2], P[i3] that P[i1]-P[i2]=P[i2]-P[i3], 1<=i1<i2&l...原创 2018-03-11 17:04:35 · 160 阅读 · 0 评论 -
hash +线段树 HDU 3973 AC's String
本题使用字符串的Hash来解决。将一个字符串看成是一个P进制的数字(可以联想10进制数),那么可以知道每一个字符串都可以被唯一表示(P> 256, 并不考虑高精度)。可是由于字符串的长度比较大,那么我们无法保存如此大的数字。于是使用Hash mod2^64来作为Hash.(的却可能会冲突,可是冲突的概率趋于无穷小)然后就是Hash(s,P) = s[0]*P^(Len-1) + s[1] *...转载 2018-05-01 16:19:08 · 180 阅读 · 0 评论