造数据
#include <bits/stdc++.h>
using namespace std;
int random(int l, int r) {
return (long long)rand() * rand() % (r - l + 1) + l;
}
int main() {
freopen("in.in", "w", stdout);
srand(time(0));
int n = random(2, 100000);
cout << n << endl;
for (int i = 1; i <= n; i++) {
cout << random(0, 1000000000) << ' ';
}
return 0;
}
对拍
#include <bits/stdc++.h>
using namespace std;
int main() {
system("g++ PEP.cpp -o PEP");
system("g++ PPEPP.cpp -o PPEPP");
system("g++ data.cpp -o data");
while(1) {
system("./data");
system("./PEP");
system("./PPEPP");
if (system("diff zhengjie.out baoli.out -Z")) {
cout << "Wrong Answer" << endl;
break;
}
cout << "Accpted" << endl;
}
return 0;
}
标签:技巧,int,PEP,system,PPEPP,++,Linux,data
From: https://www.cnblogs.com/PeppaEvenPig/p/18319722