【模板】对拍

· · 个人记录

很黑科技、很好用。

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

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(

三、对拍
批处理中:

: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