题解:P12198 Hash Killer II
Merlin_Meow · · 题解
Analysis
单模哈希实际上是非常好卡的。
由生日悖论可知,对于一个模数为
Code
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
mt19937 RAND(time(0));
int n = 100'000, l = 100;
cout << n << " " << l << endl;
for (int i = 1; i <= n; i++)
cout << char(RAND() % 26 + 'a');
cout << endl;
return 0;
}