单模数 (80)
#include #include #include #define mod 19260817#define MAXN 10005#define base 131char str[1505];unsigned long long h[MAXN];inline unsigned long long hash(){ int len = strlen(str); unsigned long long ans = 0; for(register int i=0;i
自然溢出 AC
#include #include #include #define MAXN 10005#define base 131 unsigned long long h[MAXN];char str[1505];inline unsigned long long hash(){ int len = strlen(str); unsigned long long ans = 0; for(register int i=0;i
大模数 AC
#include #include #include #define mod 212370440130137957ll#define MAXN 10005#define base 131char str[1505];unsigned long long h[MAXN];inline unsigned long long hash(){ int len = strlen(str); unsigned long long ans = 0; for(register int i=0;i
双hash AC
#include #include #include #define mod1 19260817#define mod2 19660813#define MAXN 10005#define base 131char str[1505];struct Node{ unsigned long long a,b;}h[MAXN];int N;inline bool cmp(Node x,Node y){return x.a