#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int n=100,m=100000;
double random()
{return (double)rand();}
int random(int m)
{
return (int)(random()*(m-1)+0.5);
}
int main()
{
freopen("1.txt","w",stdout);
srand(time(NULL));
printf("%d %d\n",n,m);
for(int i=0;i<m;++i)
{
if(rand()%2==0) printf("A");
else printf("B");
int x,y;
for(;;)
{
x=random(n)+1;
y=random(n)+1;
if(x!=y) break;
}
printf(" %d %d\n",x,y);
}return 0;
}
生成测试数据
最新推荐文章于 2024-07-19 19:35:07 发布