关于对拍
  • 板块灌水区
  • 楼主蒟蒻炒扇贝
  • 当前回复5
  • 已保存回复5
  • 发布时间2020/8/30 17:48
  • 上次更新2023/11/5 13:56:57
查看原帖
关于对拍
19228
蒟蒻炒扇贝楼主2020/8/30 17:48

这是我在某个巨佬的博客里复制的对拍代码:

#include<cstdio>
#include<cstdlib>
#include<ctime>

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

这一个对拍程序只能在两个程序输出的东西不同时输出输出数据

而本人想要在两个程序输出的东西不同时输出输入数据

所以这个功能该怎么实现呢?

不要回复bdfs,我查过了,每个博主写的对拍都是这个样子的

2020/8/30 17:48
加载中...