对拍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; }
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; }
By mrclr 戳这里进julao博客
> 别忘了 总有人在等着你

浙公网安备 33010602011771号