含 spj 的对拍器:
duipai_for_spj.cpp:
#include<bits/stdc++.h>
using namespace std;
int main()
{
unsigned long long i=0;
while(1)
{
i++;
system("Randomdata.exe > in.txt");
if(system("yours.exe < in.txt > spj.txt")!=0)
system("color d"),printf("Run time Error on test %llu\n",i),exit(0);
system("cls");
if(system("spj.exe")!=0)
{
system("cls");
system("color c");
printf("Wrong answer on test %llu",i);
break;
}
else
system("color a"),printf("%llu Accepted\n",i);
}
return 0;
}spj.cpp:
#include<bits/stdc++.h>
using namespace std;
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
fstream file;
file.open("in.txt",std::ios::in);
file>>n;//和cin相同,此处用于读入原题数据
file.close();
file.open("spj.txt",std::ios::in);
file>>ans//同样用于读入,此处用于读入你的输出
if(/*The answer is wrong*/) return -1;
file.close();
return 0;
}
Randomdata.cpp:
//数据生成器yours.cpp:
//This is for your code