关于配置数据
  • 板块灌水区
  • 楼主duanfeitong
  • 当前回复3
  • 已保存回复3
  • 发布时间2023/7/25 12:21
  • 上次更新2023/11/3 07:46:00
查看原帖
关于配置数据
705498
duanfeitong楼主2023/7/25 12:21

谁能告诉我这个代码出啥问题了?

#include<bits/stdc++.h>
#include<random>
#include<windows.h>
#define Random(aaa,bbb) Rand()%(bbb-aaa+1)+aaa;
using namespace std;
long long T,a,n,m,k,q;
char b[10000005];
char cb[10000005];
bool flag; 
void makedata1(int i)
{
    sprintf(b,"Overall%d.in",i);
    freopen(b,"w",stdout);
}
void makedata2(int i)
{
    fclose(stdout);
    sprintf(cb,"std.exe <Overall%d.in >Overall%d.out",i,i); 
    system(cb);
}
//int Random(int a,int b);
int main()
{
    std::mt19937 Rand(std::random_device{}());
    n=300,m=2,q=100;
    for(int nw=2;nw<=2;nw++)//测试点编号 
    {
        makedata1(nw);
        cout<<1;
		int a[n+15];
		for(int i=0;i<=n;i++) a[i]=0;
		cout<<n<<' '<<m<<' '<<q<<'\n'; 
		for(int i=1;i<=n;i++)
			a[i]=i;
		for(int j=1;j<=m;j++)
		{
			for(int i=1;i<=n;i++)
				cout<<a[i]<<' ';
			cout<<'\n';
			for(int kk=0;kk<Rand()%4+1;kk++) next_permutation(a+1,a+n+1);
		}
		for(int qq=0;qq<q;qq++)
		{
			int ll= Random(3,n*2)-1;
			cout<<ll<<'\n';
		}
		makedata2(nw);
    }
    return 0;
}


2023/7/25 12:21
加载中...