对拍

make 函数

#include<bits/stdc++.h>
using namespace std;
int main()
{
    freopen(" .in","w",stdout);
    srand(time(0));
    int n=rand()%10000;
    while(n==1)n=rand()%10000;
    int m=rand()%50000;
    printf("%d %d\n",n,m);
    for(int i=1;i<=m;i++)
    {
        int a=rand()%n+1;
        int b=rand()%n+1;
        while(a==b)b=rand()%n+1;
        printf("%d %d\n",a,b);
    }
    return 0;
}

check 函数

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int cases=0;
    while(!system("diff 1.out 2.out"))
    {
        if(cases) printf("#%d AC\n",cases);
        cases++; system("./make");
        system("./1"); system("./2");
    }
    printf("#%d WA",cases);
    return 0;
}
posted @ 2019-01-28 20:05  DTTTTTTT  阅读(143)  评论(0编辑  收藏  举报