【模板】对拍

很黑科技、很好用。

一、数据生成
比如叫seed.exe

1
2
3
4
5
6
7
8
9
10
int bigrand(){
return RAND_MAX*rand() + rand();
}

int ran(int a,int b){
return (bigrand() % (b-a+1))+ a;
}

//
ran(1,10);//[1,10]

二、准备测试程序std*1,test*1
是先打一遍暴力做std(

三、对拍
批处理中:

1
2
3
4
5
6
7
:again
seed > input.txt
test < input.txt > testout.txt
std < input.txt > stdout.txt
fc stdout.txt testout.txt
if not errorlevel 1 goto again
pause