造数据

sys
#include<bits/stdc++.h>
 
using namespace std;
 
int read(){
	int x = 0; char c = getchar();
	while(!isdigit(c))c = getchar();
	do{x = x * 10 + (c ^ 48); c = getchar();}while(isdigit(c));
	return x;
}

int main(){
	int l = read(), r = read();
	system("g++ data.cpp -o data");
	system("g++ std.cpp -o std");
	for(int i = l; i <= r; ++i){
		stringstream ss;
		string s;
		ss <<"./data>sort" << i <<".in" << endl;
		// string s = "./rand >";
		// s += i + '0';
		// s += ".in";
		ss >> s;
		ss.clear();
		system(s.c_str());
		ss <<"./std<sort" << i <<".in" <<">sort" << i <<".out" << endl;
		ss >> s;
		ss.clear();
		/*
		s = "./c < ";
		s += i + '0';
		s += ".in > ";
		s += i + '0';
		s += ".out";*/
		system(s.c_str());
	}
	return 0;
}
 
mksubtask

//Delov友情提供
#include <bits/stdc++.h>
typedef long long ll;typedef unsigned long long ull; typedef double db;typedef long double ldb;
#define fre(x) freopen(#x ".in","r",stdin),freopen(#x ".out","w",stdout)
#define Rep(i,a,b) for(int i=a;i<=b;++i) 
#define Dwn(i,a,b) for(int i=a;i>=b;--i)
#define pii pair<int,int>
#define mair make_pair
#define fir first
#define sec second
using namespace std;



void solve(){
	const string name="ball";

	vector<int>vec={ 15,25,30,30};
	vector<pii>rg ={ {1,10},{11,20},{21,30},{31,40}};
	cout<<"subtasks:"<<"\n";

	for(int i=0;i<vec.size();++i){
		cout<<"  - score: "<<vec[i]<<"\n";
		cout<<"    type: "<<"min"<<"\n";
		cout<<"    cases: "<<"[";
		int L=rg[i].fir,R=rg[i].sec;
		Rep(j,L,R){
			cout<<"\'"<<name<<j<<"\'";
			if(j<R)cout<<",";
		}
		cout<<"]\n";
	}


}

int main (){ ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);return solve(),0; }

对拍
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
int main(){
	system("g++ c.cpp -o c");
	system("g++ tj.cpp -o tj");
	system("g++ data.cpp -o data");
	int cnt = 0;
	while(true){
		system("./data > 1.in");
		//system("/usr/bin/time -f \"%es,%MKB\" ./tj < 1.in > tj.out");
		//system("/usr/bin/time -f \"%es,%MKB\" ./c < 1.in > c.out");
		system("./tj < 1.in > tj.out");
		system("./c < 1.in > c.out");
		if(system("diff c.out tj.out -Z")){
			printf("Wa\n"); break;
		}
		printf("%d\n",++cnt);
	}
	return 0;
}
posted @ 2023-04-06 21:16  Chen_jr  阅读(57)  评论(0编辑  收藏  举报