对拍呐

对拍

(这个主要是存一下对拍程序)今天用了对拍调,真香。

#include<cstdio>
#include<cstdlib>
#include<ctime>
int main()
{   long s,t;
    while(1){
        system("cls");
        do{
            system("data.exe > try.in"); //data是数据生成程序
            s=clock();
            system("a.exe < try.in > try1.out");  //a是要交的程序
            t=clock();
            system("b.exe < try.in > try2.out");  //b是正确的程序
            if(system("fc try1.out try2.out > nul"))
                break;
            else printf("AC time: %ldms
",t-s);
        }while(1);
        printf("WA time: %ldms
",t-s);  //运行时间 
        system("fc try1.out try2.out");
        system("pause>nul");
    }
    return 0;
}

来源于互联网,好像要把所有的东西放在一个文件夹中呢。

原文地址:https://www.cnblogs.com/clockwhite/p/12222525.html