对拍
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; }
光伴随的阴影