linux下的对拍程序

在比赛中我们通常会先打暴力

正解的正确与否,如果数据过大,我们就要用到对拍程序

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 int main(){
 4     int i;
 5   for (i=1;;i++){
 6         printf("The result of No. %d Case is:  ",i);
 7         system("./rand");
 8         system("./std");
 9         system("./my");
10         if (system("diff std.out my.out")){
11             printf("Wrong Answer\n");
12             return 0;
13         }
14         else printf("Accepted\n");
15     }
16     return 0;
17 }
对拍

 

posted @ 2021-06-10 21:43  fengwu2005  阅读(71)  评论(0编辑  收藏  举报