求助,造数据时输出卡住
  • 板块灌水区
  • 楼主Kio_
  • 当前回复7
  • 已保存回复7
  • 发布时间2021/11/27 17:12
  • 上次更新2023/11/3 23:26:54
查看原帖
求助,造数据时输出卡住
127925
Kio_楼主2021/11/27 17:12

RT,等了很久没有出现那个“请按任意键继续”的提示 (疑似是输出文件太大了......把造数据代码中的n,m调小一点又恢复了)

求助,以及请告诉我解决的方法,谢谢大佬 ;w;

代码如下:

#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<windows.h>

using namespace std;

const int mod = 100;

int main(){
   srand(time(0));
   freopen("apex05.in","w",stdout);
   int n=2000,m=2000,x=(rand()-1)%n+1,y=(rand()-1)%m+1;
   long long S=1ll*(rand()-1)*(rand()-1)*(rand()-1)*(rand()-1)%(1ll*mod*mod);
   printf("%d %d %d %d %lld\n",n,m,x,y,S);
   for(int i=1;i<=n;i++){
   	for(int j=1;j<=m;j++) printf("%d ",(rand()-1)*(rand()-1)%mod+1);
   	printf("\n");
   }
   for(int i=1;i<=n;i++){
   	for(int j=1;j<=m;j++){
   		if(i==x&&j==y) printf("1 ");
   		else printf("%d ",(rand()-1)*(rand()-1)%mod+1);
   	}
   	printf("\n");
   }
   return 0;
}
2021/11/27 17:12
加载中...