有关对拍
/(prework/)
你需要随机数生成器.exe,sol.exe,bruteforce.exe,以及对拍.exe
/(code/)
//rand.cpp
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1e9;
signed main(){
freopen("in.in","w",stdout);
int x=rand()*rand()%mod*rand()%mod*rand()%mod+1;
int y=rand()*rand()%mod*rand()%mod*rand()%mod+1;
cout<<x<<" "<<y<<endl;
}
//sol.cpp
#include<bits/stdc++.h>
int main()
{
freopen("in.in","r",stdin);
freopen("1.out","w",stdout);
int a,b;
scanf("%d%d",&a,&b);
printf("%d",a+b);
return 0;
}
//bruteforce.cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("in.in","r",stdin);
freopen("2.out","w",stdout);
int a,b;
cin>>a>>b;
cout<<a+b;
return 0;
}
//duipai.cpp
#include<bits/stdc++.h>
using namespace std;
inline int read(){
int x=0,f=1;
char ch=getchar();
while(!isdigit(ch)){
if(ch=='-') f=-1;
ch=getchar();
}
while(isdigit(ch)){
x=(x<<1)+(x<<3)+(ch^48);
ch=getchar();
}
return x*f;
}
int main(){
freopen("result.out","w",stdout);
for(int T=1;T<=10000;++T){
system("D://rand.exe");
double st=clock();
system("D://sol.exe");
double ed=clock();
system("D://vio.exe");
if(system("fc D://1.out D://2.out")){
printf("Wrong Answer on #%d test, use time: %.01fms/n",T,ed-st);
return 0;
}
else{
printf("Accpeted on #%d test, use time: %.01fms/n",T,ed-st);
}
}
}
/(duipai/)
这个时候你只需要运行duipai.exe就可以了!
P.S. 所有文件都得放在同一个目录下
原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/272734.html