哈希
文章平均质量分 81
nka_kun
ACMer
展开
-
Sort String 2018牛客多校第三场 E题 (字符串hash)
Eddy likes to play with string which is a sequence of characters. One day, Eddy has played with a string S for a long time and wonders how could make it more enjoyable. Eddy comes up with following pr...原创 2018-07-27 20:32:24 · 441 阅读 · 0 评论 -
字符串hash方法
网上整理的一篇文章,感觉不错,贴此供用. 求一个字符串的hash值: •现在我们希望找到一个hash函数,使得每一个字符串都能够映射到一个整数上 •比如hash[i]=(hash[i-1]*p+idx(s[i]))%mod •字符串:abc,bbc,aba,aadaabac •字符串下标从0开始 •先把a映射为1,b映射为2,c->3,d->4,即idx(a)=1, idx...原创 2018-07-27 20:51:01 · 2509 阅读 · 0 评论 -
SCU-4438 Censor(字符串哈希||KMP)
Censor frog is now a editor to censor so-called sensitive words (敏感词). She has a long text pp. Her job is relatively simple -- just to find the first occurence of sensitive word ww and remove it. f...原创 2018-07-28 11:13:48 · 7197 阅读 · 0 评论