windows版
#include<cstdio>
#include<iostream>
#include<ctime>
using namespace std;
double times,times2;
int main(){
int t = 0;
while ( true ){
system("datamaker.exe");
times = clock();
system("4327.exe < input.txt > 1.out");
times = clock() - times;
times2 = clock();
system("std.exe < input.txt > 2.out");
times2 = clock() - times2;
if ( system("fc 1.out 2.out > log.txt") ){
system("pause");
break;
}
cout<<"correct "<<++t<<endl;
cout<<times / 1000<<" "<<times2 / 1000<<endl;
}
return 0;
}
LINUX 版
#include<bits/stdc++.h>
#include<ctime>
using namespace std;
double times,times2;
int main(){
int t = 0;
while ( true ){
system("./datamaker");
times = clock();
system("./B < input.txt > 1.out");
times2 = clock();
system("./std < input.txt > 2.out");
times2 = clock() - times2;
if ( system("diff 1.out 2.out > log.txt") ){
system("pause");
break;
}
cout<<"correct "<<++t<<endl;
cout<<times / 1000<<" "<<times2 / 1000<<endl;
}
return 0;
}