Welcome, Guest! Sign Up RSS

Clever Space

Friday, 11.22.2024
Main » 2013 » October » 10

RKhash

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define N 200010
#define M 61
#define PRIME 13331
using namespace std;
typedef unsigned long long ULL;
typedef long double LD;
char a[N],b[N];
ULL c[N],p[N],g[2*M],tmp;
int f[N][M],len[N];
ULL F(char cc){return cc-'a'+1;};
int main()
{
  scanf("%s",a+1);
  scanf("%s",b+1);
  int i,j;
  int n=strlen(a+1), ... Read more »
Views: 338 | Added by: dhy0077 | Date: 10.10.2013