摘要:
Censor frog is now a editor to censor so-called sensitive words (敏感词). She has a long text p . Her job is relatively simple -- just to find the first 阅读全文
摘要:
#include #include #include #include using namespace std; typedef long long ll; pairpp; pair Hash(ll a[21]) { ll ans1=0,ans2=0; for(ll i=0;i<21;i++) ans1=(ans1*1000000013+a[i])%1000000007; for(ll... 阅读全文
摘要:
百度文库 : https://wenku.baidu.com/view/b7d3d1c6804d2b160a4ec090.html 求一个字符串的hash值: •现在我们希望找到一个hash函数,使得每一个字符串都能够映射到一个整数上 •比如hash[i]=(hash[i-1]*p+idx(s[i] 阅读全文