- 袁野老师 的博客
北京普及强化班day10 对拍代码
- @ 2026-2-11 11:35:28
makedata.cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("data.in","w",stdout);
srand(time(0));
int n = 100;
cout << n << "\n";
for (int i=1; i<=n; ++i)
cout << rand() % 10000 + 1 << " ";
}
windows对拍代码
#include<cstdio>
#include<cstdlib>
#include<iostream>
int main()
{
for(int i=1;i<=10000000;i++)
{
system("md.exe > data.txt");
system("a.exe < data.txt > test1.out");
system("b.exe < data.txt > test2.out");
// if(i/100>tmp) {printf("-- %d --\n",i);tmp=i/100;}
if(system("fc test1.out test2.out"))
{
printf("wrong in --> %d \n",i);
break;
}
printf("process %d is correct\n",i);
}
return 0;
}