出题助手

数据生成助手

#include<bits/stdc++.h>
std::mt19937_64 mt(6666667);
long long rnd(long long l,long long r){
	std::uniform_int_distribution<long long> u(l,r);
	return u(mt);
}

int sys(const std::string &st){
	return system(st.c_str());
}
template<typename... Ar>
int sys(const std::string &st,const std::string &st2,Ar... ls){
	return sys(st+" "+st2,ls...);
}
void write(const std::string &file,const std::string &st){
	std::ofstream fout(file);
	fout<<st;
	return ;
}
template<typename Fn>
void make(const std::string &file,const std::string &name,int cnt,const Fn &sc){
	using std::cerr; using std::endl;
	for(int i=1;i<=cnt;i++){
		cerr<<"file: "<<file<<"  name: "<<name<<"  cnt: "<<i<<endl;
		write(file+".in",sc());
		sys(file+".exe");
		sys("copy",file+".in",file+"_"+name+"_"+std::to_string(i)+".in");
		sys("copy",file+".out",file+"_"+name+"_"+std::to_string(i)+".out");
		sys("del",file+".in");
		sys("del",file+".out");
		cerr<<endl;
	}
	return ;
}
posted @ 2025-02-03 17:05  zhiyin123123  阅读(11)  评论(0)    收藏  举报
目录侧边栏

qwq