对拍
今天用对拍改了两道陈年老题,就很开心。
把c++的对拍程序放上来
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
int T=0;
while (1)
{
T++;
system("D:\\random.exe");
system("D:\\sol.exe");
system("D:\\bf.exe");
if (system("fc D:\\data.out D:\\data.ans"))
{
printf("WA");
return 0;
}
else
{
printf("AC,test #%d\n",T);
}
}
}
数据生成器
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<cstdlib>
#include<ctime>
using namespace std;
int random(int n)
{
return (long long)rand()*rand()%n;
}
int main()
{
freopen("data.in","w",stdout);
srand((unsigned)time(0));
}