[BZOJ3098]Hash Killer II

题目链接:

BZOJ3098

这题正解超乎想象。。

先是一个结论:生日攻击

大意是在\(n\)个数中随机选\(\sqrt n\)个即有冲突值。

那么这题\(n=10^9+7(Mod)\),所以直接输出一个长度为\(\sqrt n\)(当然直接\(10^5\)更长更稳)的随机字符串即可。。。

字符串题??数学题!!

#include <ctime>
#include <cstdio>
#include <cstdlib>

int main()
{
    srand((unsigned)time(0)),puts("100000 20");
    for(int i=100000;i;--i)putchar(rand()%26+97);
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/LanrTabe/p/10176661.html