对拍Windows/UNIX

Windows:

#include<cstdio>
#include<cstdlib>
#include<ctime>
typedef double db;
using namespace std;

int main()
{
    for(int t = 1; t <= 1000; ++t)
    {
        system(".\\random.exe");
        db Beg = clock();
        system(".\\ac.exe");
        db End = clock();
        system(".\\bf.exe");
        if(system("fc .\\ac.out .\\bf.out"))
        {
            printf("WA\n"); return 0;
        }
        else printf("#%d AC %.2lfms\n", t, End - Beg);
    }
    return 0;
}
View Code

 

UNIX:

#include<cstdio>
#include<ctime>
#include<cstdlib>
using namespace std;
typedef double db;

int main()
{
  for(int i = 1; i <= 10000; ++i)
    {
      system("//home//noilinux//Desktop//random");
      db Beg = clock();
      system("//home//noilinux//Desktop//sol");
      db End = clock();
      system("//home//noilinux//Desktop//bf");
      if(system("diff //home//noilinux//Desktop//sol.out //home/noilinux//Desktop//bf.out"))
      {
      puts("WA"); return 0;
      }
      else printf("AC #%d, Time : %.0lfms\n", i, End - Beg);
    }
  return 0;
}
View Code

 By mrclr 戳这里进julao博客

posted @ 2018-10-08 21:46  白怀潇  阅读(160)  评论(0编辑  收藏  举报