提供一个样例生成器
查看原帖
提供一个样例生成器
644112
Sinktank楼主2025/7/28 13:51
#include<bits/stdc++.h>
using namespace std;
int n=50000;
random_device sd;
mt19937 rd(sd());
int ran(int l,int r){
	return rd()%(r-l+1)+l;
}
signed main(){
	cout<<n<<"\n";
	for(int i=1;i<=n;i++){
		for(int j=1;j<=4;j++) cout<<ran(-1e9,1e9)<<" ";
		cout<<"\n";
	}
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
using namespace chrono;
signed main(){
	while(1){
		system("gene.exe > a.in");
		
		auto start = steady_clock::now();
		system("mine.exe < a.in > mine.out");
		auto end = steady_clock::now();
		auto tt = duration_cast<microseconds>(end - start);
		cout<<"MINE : "<<1.0*tt.count()/1000<<" ms\n";
		
		start = steady_clock::now();
		system("std.exe < a.in > std.out");
		end = steady_clock::now();
		tt = duration_cast<microseconds>(end - start);
		cout<<"STD  : "<<1.0*tt.count()/1000<<" ms\n\n";
		
		if(system("fc mine.out std.out")) break;
	}
	return 0;
}
2025/7/28 13:51
加载中...