HDU 1880 魔咒词典

字符串哈希水题
#include 
#include 
#include 
#include 
#include 
using namespace std;
#define debug cout<<"***"< m1,m2;
const int maxn=105000;
char spell[maxn][100];
char magic[maxn][100];
int f1[maxn];
int f2[maxn];
int pos1=1,pos2=1;
unsigned int BKDRHash(char *str)
{
    unsigned int seed = 131;
    unsigned int hash = 0;

    while (*str){
        hash = hash * seed + (*str++);
    }
    return (hash & 0x7FFFFFFF);
}
void init(){
	for(int i=1;i

你可能感兴趣的:(字符串)