BZOJ3098: Hash Killer II(构造)
链接: lhttps://www.lydsy.com/JudgeOnline/problem.php?id=3098
题意:构造一个可以卡掉mod = 1e9+7,base随意的hash,数据n l str,使长度为n的str中的长度为l的两个以上的字串起hash冲突
根据生日悖论,xjb构造
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int main() {
int N = 1e5, l = 25;
printf("%d %d\n", N, l);
for(int i = 1; i <= N; i++)
printf("%c", 'a' + rand() % 26);
return 0;
}