一个简单的hash
#include <iostream>
#include <cstdio>
using namespace std;
unsigned ans=0;
unsigned BKDRHash(char *str)
{
unsigned seed = 131; // 31 131 1313 13131 131313 etc..
unsigned hash = 0;
while (*str)hash = hash * seed + (*str++);
return (hash & 0x7FFFFFFF);
}
int main()
{
scanf("%s",a);
ans=BKDRHash(a);
printf("%u\n",ans);
return 0;
}