@echo off :loop maker.exe > data.in std.exe < data.in > std.out force.exe < data.in > force.out fc std.out force.out if not errorlevel 1 goto loop pause goto loop
*nix
需要准备的文件
std 要对拍的程序
force 检验std.exe是否输出正确的结果
maker 生成数据
check.sh 对拍脚本
1 2 3 4 5 6 7 8 9 10 11 12 13
while : do ./maker > data.in echo"force time:" time ./force < data.in > force.out echo"std time:" time ./std < data.in > std.out if [[ `diff force.out std.out` != "" ]]; then echo"gg" exit fi done